[Xml-compile] Perl WSDL11 Can't Make it to Work on WSDL with XML import

ritchie babaylan rrb011270 at inbox.com
Sun Apr 19 23:47:11 GMT 2015


Hi,

I am a newbie to Perl programming.

In order to learn accessing a soap service, I tried to create a soap client that can connect to this in which I was successful to use the web service.

Now, I migrated my code to connect to my company's soap service but I encountered a problem.

"The error says that their were no port_type and no operation as well."

See code snippet below.

----------------<code>----------------
#!/usr/bin/perl

use 5.018;
use strict;
use warnings;

use Data::Dumper qw{Dumper};
use XML::Compile::SOAP11;
use XML::Compile::SOAP12;
use XML::Compile::WSDL11;

my $WsdlUrl;
my $WsdlXml;
my $SoapSrvc;
my (%SoapOps);

$WsdlUrl = "http://maxcavmes04/CamstarExternal/camstar.svc";
$WsdlXml = XML::LibXML->new->parse_file($WsdlUrl);
$SoapSrvc = XML::Compile::WSDL11->new($WsdlXml);

print Dumper(\$SoapSrvc);

foreach my $SoapOp ($SoapSrvc->operations())
{
    # XML::Compile::SOAP 2.x
    if ($XML::Compile::SOAP::VERSION > 1.99)
    {
        $SoapOps{$SoapOp->name} 
            = $SoapSrvc->compileClient(operation => $SoapOp->name,
                                       port => SOAP_PORT_TYPE);
    }
    else  # XML::Compile::SOAP 0.7x
    {
        $SoapOps{$SoapOp->{operation}} 
            =  $SoapSrvc->compileClient(operation => $SoapOp->{operation},
                                        port => SOAP_PORT_TYPE);
    }
}

print "\n\n";
exit(0);
----------------</code>----------------

Investigating it further why it won't work, I use a 3rd party software called .NET WebService Studio. I realize from the returned of the WebService Studio that my company's Soap service uses two WSDL file through WSDL:Import.

I would like to ask from this community of how I can modify my program in order to have access to company's soap service using WSDL11.

I have also attached the dumped data of the soap service connection as reference through print Dumper(\$SoapSrvc) statement.

Link: https://drive.google.com/file/d/0B_RcFVjJJ4Wlc0hDZVpoN0o3aU0/view?usp=sharing


In addition, I tried using the XML::CompileX::Schema::Loader with the code snippet below but I get an error: no definitions for 'portType' found. 

----------------<code>----------------
#!/usr/bin/perl

use 5.018;
use strict;
use warnings;

use Data::Dumper qw{Dumper};
use XML::Compile::SOAP11;

use XML::Compile::WSDL11;
use XML::Compile::Transport::SOAPHTTP;
use XML::CompileX::Schema::Loader;


my $WsdlUrl;
$WsdlUrl = "http://abcdemes04/CamstarExternal/camstar.svc";

my $wsdl   = XML::Compile::WSDL11->new();
my $loader = XML::CompileX::Schema::Loader->new(
    wsdl => $wsdl,
    uris => $WsdlUrl,
);

print Dumper(\$wsdl);

print ">>>>---------------------->>>>\n";
$loader->collect_imports();
print Dumper(\$loader);

print "<<<<----------------------<<<<\n";
$wsdl->compileCalls();

print "\n\n";
exit(0);
----------------</code>----------------

I dumped the content of the $loader variable through Dumper() and notice that 'portType' was define although I am not so sure if it is correct. See dumped data from a given link.

Link: https://drive.google.com/file/d/0B_RcFVjJJ4WldFZNTUptMFB6RlE/view?usp=sharing


Thanks,
Ritchie

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/manager





More information about the Xml-compile mailing list