Martin90 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I have some troubles connecting to SOAP WSDL service using perl and module XML::Compile::SOAP.

Service to which I am trying to connect doesn't provide any documentation for perl they well documented php connection:

PHP call for status method:

require_once('nusoap.php'); $soapClient = new nusoap_client('https://myservice.com/service.php +?wsdl', true); $result = $soapClient->call( 'doQueryAllSysStatus', array( array( 'countryId' => 1, 'webapiKey' => 'WEBAPI_KEY' ) ) );

In perl I wrote:

use XML::Compile::WSDL11; # use WSDL version 1.1 use XML::Compile::SOAP11; # use SOAP version 1.1 use XML::Compile::Transport::SOAPHTTP my $wsdl = XML::Compile::WSDL11->new("https://myservice.com/service.ph +p?wsdl"); $wsdl->importDefinitions('doQueryAllSysStatus'); my $call = $wsdl->compileClient('doQueryAllSysStatus'); #print $call, "\n";

Returns, don't know how to interpret XML data.

I am confused and have no idea how to reach this service. I hope you monks could help ;)

Update:

Problem solved ;) Thanks.

Replies are listed 'Best First'.
Re: Connection to SOAP WSDL service using perl
by kcott (Archbishop) on Oct 27, 2013 at 05:19 UTC
Re: Connection to SOAP WSDL service using perl
by runrig (Abbot) on Oct 27, 2013 at 16:33 UTC

    Original parent node thanks to google cache:

    Hello Monks,

    I have some troubles connecting to SOAP WSDL service using perl and module XML::Compile::SOAP.

    Service to which I am trying to connect doesn't provide any documentation for perl they well documented php connection:

    PHP call for status method:

    require_once('nusoap.php'); $soapClient = new nusoap_client('https://myservice.com/service.php +?w +sdl', true); $result = $soapClient->call( 'doQueryAllSysStatus', array( array( 'cou +ntryId' => 1, 'webapiKey' => 'WEBAPI_KEY' ) ) );
    In perl I wrote:
    use XML::Compile::WSDL11; # use WSDL version 1.1 use XML::Compile::SOAP11; # use SOAP version 1.1 use XML::Compile::Transport::SOAPHTTP my $wsdl = XML::Compile::WSDL11->new("https://myservice.com/service.ph + +p?wsdl"); $wsdl->importDefinitions('doQueryAllSysStatus'); my $call = $wsdl->compileClient('doQueryAllSysStatus');
      And the problem was ... ?
      my $wsdl = XML::Compile::WSDL11->new("https://myservice.com/service.ph +p?wsdl");
      I'm pretty sure XML::Compile will not download the wsdl from a URL. You'll have to do that yourself, and then pass the file name to new().
      $wsdl->importDefinitions('doQueryAllSysStatus'); my $call = $wsdl->compileClient('doQueryAllSysStatus');
      I'm also pretty sure you do not need to call importDefinitions. At least not with the method you want to compile. importDefinitions is, e.g., for supplying additional xsd files that define the service. Which you will have to download if there are any.