Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > SOAP::Lite and WSDL namespace - please help

Reply
Thread Tools

SOAP::Lite and WSDL namespace - please help

 
 
spacegoat
Guest
Posts: n/a
 
      11-04-2005
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:ata->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"
xmlnss="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
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlnssd="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.

 
Reply With Quote
 
 
 
 
ced@carios2.ca.boeing.com
Guest
Posts: n/a
 
      11-06-2005

spacegoat wrote:
> 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,
--
Charles DeRykus

 
Reply With Quote
 
 
 
 
spacegoat
Guest
Posts: n/a
 
      11-06-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
webservices, wsdl & xsd (schema-2-wsdl) Dark Java 1 11-14-2008 07:58 PM
wsdl.exe fails with WebMethods generated wsdl file mrnu ASP .Net Web Services 0 06-07-2004 04:51 PM
WSDL file produces useless class when imported with WSDL.exe RH ASP .Net Web Services 1 05-27-2004 09:40 PM
is the w3c's schema for wsdl and wsdl/soap binding possibly buggy ? _clb_ Chris Bedford XML 0 08-20-2003 11:52 PM
WSDL.EXE: WSDL Import Directive Stephen Edgecombe ASP .Net Web Services 0 08-13-2003 06:38 AM



Advertisments