If you are using wsdl2perl.pl, then there would be a different format. In general, you might try something like: #!/usr/bin/perl
use strict;
use warnings;
use SOAP::WSDL;
use Data::Dumper;
use Devel::SimpleTrace;
my $soap = SOAP::WSDL->new(
wsdl => 'file://bar.wsdl',
);
my ($body_ref, $header_ref);
my $result = $soap->call('NewEvent', $body_ref, $header_ref);
print Dumper($result);
I'm pressed for time right now, but I'll post a full example for you later tonight.
Update: This is as far as I can go right now. I'll have to finish it tomorrow.
Update: 3-22-10
As far as I can tell, the module works fine. The problem is with the wsdl---it's not valid. Here's the current code:
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::WSDL;
use SOAP::Lite +trace => 'debug';
my $soap = SOAP::WSDL->new(
wsdl => 'file://root/Desktop/duckie/primes.xml',
);
$soap->wsdlinit(
servicename => 'PrimeNumbers',
portname => 'PrimeNumbersSoap',
);
my $result = $soap->call('GetPrimeNumbers');
print $result, "\n";
First:wsdl2perl.pl -b /root/Desktop/duck http://www50.brinkster.com/vbfacile
+inpt/np.asmx?wsdl
Second: primes.wsdl?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" x
+mlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www
+.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soa
+p/encoding/" xmlns:tns="http://microsoft.com/webservices/" xmlns:tm="
+http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://sche
+mas.xmlsoap.org/wsdl/mime/" targetNamespace="http://microsoft.com/web
+services/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://m
+icrosoft.com/webservices/">
<s:element name="GetPrimeNumbers">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="max" type="s:
+int"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetPrimeNumbersResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetPrimeNumbe
+rsResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true" type="s:string"/>
</s:schema>
</wsdl:types>
<wsdl:message name="GetPrimeNumbersSoapIn">
<wsdl:part name="parameters" element="tns:GetPrimeNumbers"/>
</wsdl:message>
<wsdl:message name="GetPrimeNumbersSoapOut">
<wsdl:part name="parameters" element="tns:GetPrimeNumbersResponse"
+/>
</wsdl:message>
<wsdl:message name="GetPrimeNumbersHttpGetIn">
<wsdl:part name="max" type="s:string"/>
</wsdl:message>
<wsdl:message name="GetPrimeNumbersHttpGetOut">
<wsdl:part name="Body" element="tns:string"/>
</wsdl:message>
<wsdl:message name="GetPrimeNumbersHttpPostIn">
<wsdl:part name="max" type="s:string"/>
</wsdl:message>
<wsdl:message name="GetPrimeNumbersHttpPostOut">
<wsdl:part name="Body" element="tns:string"/>
</wsdl:message>
<wsdl:portType name="PrimeNumbersSoap">
<wsdl:operation name="GetPrimeNumbers">
<wsdl:input message="tns:GetPrimeNumbersSoapIn"/>
<wsdl:output message="tns:GetPrimeNumbersSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="PrimeNumbersHttpGet">
<wsdl:operation name="GetPrimeNumbers">
<wsdl:input message="tns:GetPrimeNumbersHttpGetIn"/>
<wsdl:output message="tns:GetPrimeNumbersHttpGetOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="PrimeNumbersHttpPost">
<wsdl:operation name="GetPrimeNumbers">
<wsdl:input message="tns:GetPrimeNumbersHttpPostIn"/>
<wsdl:output message="tns:GetPrimeNumbersHttpPostOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PrimeNumbersSoap" type="tns:PrimeNumbersSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" sty
+le="document"/>
<wsdl:operation name="GetPrimeNumbers">
<soap:operation soapAction="http://microsoft.com/webservices/Get
+PrimeNumbers" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PrimeNumbersHttpGet" type="tns:PrimeNumbersHttpG
+et">
<http:binding verb="GET"/>
<wsdl:operation name="GetPrimeNumbers">
<http:operation location="/GetPrimeNumbers"/>
<wsdl:input>
<http:urlEncoded/>
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PrimeNumbersHttpPost" type="tns:PrimeNumbersHttp
+Post">
<http:binding verb="POST"/>
<wsdl:operation name="GetPrimeNumbers">
<http:operation location="/GetPrimeNumbers"/>
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded"/>
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PrimeNumbers">
<wsdl:port name="PrimeNumbersSoap" binding="tns:PrimeNumbersSoap">
<soap:address location="http://www50.brinkster.com/vbfacileinpt/
+np.asmx"/>
</wsdl:port>
<wsdl:port name="PrimeNumbersHttpGet" binding="tns:PrimeNumbersHtt
+pGet">
<http:address location="http://www50.brinkster.com/vbfacileinpt/
+np.asmx"/>
</wsdl:port>
<wsdl:port name="PrimeNumbersHttpPost" binding="tns:PrimeNumbersHt
+tpPost">
<http:address location="http://www50.brinkster.com/vbfacileinpt/
+np.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Third: the code(needs more work, but it's the general idea:))
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Devel::SimpleTrace;
use SOAP::WSDL;
my $soap = SOAP::WSDL->new(
wsdl => 'file:///root/Desktop/duck/primes.wsdl',
);
my ($body_ref, $header_ref);
my $result = $soap->call('GetPrimeNumbers', $body_ref, $header_ref);
print Dumper($result);
|