Click here to get back home

SOAP::Lite and .wsdl files

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
SOAP::Lite and .wsdl files Dennis Roesler 04-07-2006
Posted by Dennis Roesler on April 7, 2006, 11:36 am
Please log in for more thread options


Hi,

I'm struggling with SOAP::Lite and using .wsdl files. Given the
configuration shown below, what should be in these sections of the .wsdl
file?

<operation name="testWsdl">
<soap:operation soapAction="??????????????????????????????????"/>
<soap:address location="http://my.host.com/soap"/>

Are there other aspects of Test.wsdl that aren't properly configured?

I've tried many variations for the above and whatever I use I always get
"Unrecognized method 'testWsdl'. List of available method(s):"
with no list of available methods. I've also used +trace on SOAP::Lite
and don't really get anything meaningful, at least to me.

The only reason it's important to me to use the .wsdl files is that the
service is intended for a .NET client.

Thanks

Dennis
d underscore roesler at agilent dot com

/home/droesler/client.pl
-----------------------------------------------------------
#!/bin/perl

use strict;
use warnings;
use SOAP::Lite;

my $var = $ARGV[0];

# This works
my $soap = SOAP::Lite
-> proxy('http://my.host.com/soap/TestWsdl.cgi')
-> uri('/MyPkgs/TestPkg');
my $result = $soap->testWsdl($var);

# This doesn't
#my $result = SOAP::Lite
# -> service('http://my.host.com/wsdl/Test.wsdl')
# -> testWsdl('Hello World');

unless ($result->fault) {
print $result->result();
} else {
print join ', ',
$result->faultcode,
$result->faultstring;
}

__END__

/opt/sdo/soap/MyPkgs/TestPkg.pm
-------------------------------------------------------
package MyPkgs::TestPkg;

use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(testWsdl);

sub testWsdl {
my ($class, $var) = @_;

return SOAP::Data->name('Test')
->type('string')
->value("Test Passed: $var");
}

1;


/opt/sdo/soap/TestWsdl.cgi
------------------------------------------------------
#!/bin/perl

use strict;
use warnings;
use SOAP::Transport::HTTP;
use lib '/opt/sdo/soap';
use MyPkgs::TestPkg;

SOAP::Transport::HTTP::CGI
-> dispatch_to('/opt/sdo/soap', 'MyPkgs::TestPkg')
-> handle;


/opt/sdo/wsdl/Test.wsdl
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="TestWsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://my.host.com/wsdl/Test.wsdl"
targetNamespace="http://my.host.com/wsdl/Test.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<message name="TestRequest">
<part name="var" type="xsd:string"/>
</message>

<message name="TestResponse">
<part name="result" type="xsd:string"/>
</message>

<portType name="TestPortType">
<operation name="testWsdl">
<input message="tns:TestRequest"/>
<output message="tns:TestResponse"/>
</operation>
</portType>

<binding name="TestBinding" type="tns:TestPortType">
<binding style="rpc"                                                                 
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="testWsdl">
<soap:operation                                                                 
soapAction="??????????????????????????????????"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>

<service name="testWsdl">
<documentation>Testing Web Services with wsdl</documentation>
<port name="TestPortType" binding="tns:TestBinding">
<soap:address location="http://my.host.com/soap"/>
</port>
</service>
</definitions>

Similar ThreadsPosted
SOAP::Lite WSDL method with multiple soap:body parts February 16, 2005, 3:32 pm
SOAP::Lite and WSDL namespace - please help November 4, 2005, 10:43 am
SOAP::Lite POD::WSDL and .NET clients April 25, 2007, 12:41 pm
How to generate WSDL file from SOAP::Lite May 25, 2007, 5:48 am
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring November 5, 2004, 8:45 pm
RFC: SOAP module with implicit WSDL generation April 4, 2008, 2:38 pm
SOAP::WSDL error accessing remote site. July 19, 2007, 3:14 am
Writing a HTML/ASP SOAP client for a SOAP::Lite destination March 16, 2005, 5:19 pm
Help with SOAP::Lite January 19, 2005, 11:35 pm
SOAP::Lite March 3, 2005, 6:13 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap