SOAP::Lite and WSDL namespace - please help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I've been trying to send a request to a public SOAP server with
SOAP::Lite with no success. Here's the WSDL specifications ->

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

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(' ');
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

Expected arguments:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap=" /"
xmlns:tns=" "xmlns:xs=" ">

Actual sent arguments:
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi=" "
xmlns:SOAP-ENV=" /"xmlns:xsd=" ">
      <GetPrimeNumbers xmlns="">
         <Max xsi:type="xsd:int">10</Max>

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

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.

Site Timeline