SOAP::Lite and WSDL namespace - please help

Discussion in 'Perl Misc' started by spacegoat, Nov 4, 2005.

  1. spacegoat

    spacegoat Guest

    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.
    spacegoat, Nov 4, 2005
    #1
    1. Advertising

  2. spacegoat

    Guest

    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
    , Nov 6, 2005
    #2
    1. Advertising

  3. spacegoat

    spacegoat Guest

    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.
    spacegoat, Nov 6, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aaron Brady

    SQL, lite lite lite

    Aaron Brady, Dec 29, 2008, in forum: Python
    Replies:
    15
    Views:
    734
    Aaron Brady
    Jan 1, 2009
  2. Andrew Tkachenko

    SOAP::Lite +wsdl

    Andrew Tkachenko, Mar 5, 2005, in forum: Perl Misc
    Replies:
    0
    Views:
    142
    Andrew Tkachenko
    Mar 5, 2005
  3. ashgromnies
    Replies:
    0
    Views:
    190
    ashgromnies
    Apr 24, 2006
  4. John Bokma

    SOAP::Lite + wsdl misunderstanding?

    John Bokma, Jan 24, 2007, in forum: Perl Misc
    Replies:
    0
    Views:
    118
    John Bokma
    Jan 24, 2007
  5. J. Gleixner
    Replies:
    0
    Views:
    392
    J. Gleixner
    Feb 12, 2008
Loading...

Share This Page