SOAP::Lite and WSDL namespace - please help

S

spacegoat

Hi,

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:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://www50.brinkster.com/vbfacileinpt/np"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<tns:GetPrimeNumbers>
<tns:Max>10</tns:Max>
</tns:GetPrimeNumbers>
</soap:Body>
</soap:Envelope>

Actual sent arguments:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<GetPrimeNumbers xmlns="">
<Max xsi:type="xsd:int">10</Max>
</GetPrimeNumbers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

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

ced

spacegoat said:
Hi,

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.

...

Sorry, I have no answer but you might have better luck on
comp.lang.perl.modules.
Also, www.soaplite.com is a good resource and there're several mailing
lists
available there.


hth,
 
S

spacegoat

Hi Charles,

Thanks anyway for the reply. I've posted the same topic in
c.l.p.modules, and similarly I haven't got any replies yet.

However, just last night I found a module that could be my saviour.
Hopefully this would help anyone that have the same problems :3).

Check this Perl module out -> SOAP::WSDL. It sits on the top of
SOAP::Lite and it also handles complex types and namespaces much much
better. I've done a preliminary testing and it seems to be exactly what
I need, but I haven't given a further test yet.

That said, I hope SOAP::Lite gets improved in the near future, as
ideally it should be able to handle all these stuff anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top