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
webservicex 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.
#!/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->{operati
+on},
port => SOAP_PORT_TYPE);
}
}
print "\n\n";
exit(0);
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.