SOAP::Lite and .wsdl files

SOAP::Lite and .wsdl files

am 07.04.2006 17:36:03 von avidfan

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?





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
------------------------------------------------------------ --------------

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">

















transport="http://schemas.xmlsoap.org/soap/http"/>

soapAction="??????????????????????????????????"/>










Testing Web Services with wsdl