SOAP::Lite and WSDL namespace - please help
am 04.11.2005 19:43:37 von spacegoatHi,
I've been trying to send a request to a public SOAP server with
SOAP::Lite with no success. Here's the WSDL specifications ->
http://www50.brinkster.com/vbfacileinpt/np.asmx?wsdl
It's just a simple server that expects a string number wrapped in a
complex type and returns a series of prime numbers less than the given
number.
Here's the script that I wrote:
#!/usr/bin/perl -w
use strict;
use SOAP::Lite +trace => qw(transport trace);
my $var = SOAP::Data->name('Max' => '10');
my $soap =
SOAP::Lite->service('http://www50.brinkster.com/vbfacileinpt /np.asmx?wsdl');
print $soap->GetPrimeNumbers($var);
Running this script, I got an error message returned from the server:
"The Max number must be > or = 5". It appears that the server doesn't
recognise the data I'm sending.
After further investigation, I found out that the data format is not
quite right, as the data type isn't recognised due to missing namespace
definition:
Expected arguments:
Actual sent arguments:
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xm lns:xsd="http://www.w3.org/2001/XMLSchema">
After tampering with my XML data, I found out that it was missing the
xmlns:tns definition in the envelope, and both GetPrimeNumbers and Max
have to be prefixed with the name space (tns:GetPrimeNumbers and
tns:Max).
I've got no idea on how to do this (defining the extra namespace in the
envelope and prefixing the arguments with 'tns') with SOAP::Lite. If
anyone could give any helps, I'd really really appreciate it. I'm very
desperate at the moment after trying to get things working for 2 days
:(
Please help.