SOAP::LITE

Discussion in 'Perl Misc' started by neil.holmes@zoom.co.uk, Nov 10, 2006.

  1. Guest

    I am trying to make use of SOAP::LITE for calling Web Services from
    Perl.

    I have Windows and Linux Installations.

    On Windows the following works fine :-

    #!/usr/local/bin/perl
    use SOAP::Lite;
    print SOAP::Lite
    -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    -> TK_ADD_ENTRY('Neil Holmes','Greatest Hits
    Volume','CD','9.99','www.proiv.com');

    The data is added to the application behind the web services and a
    success flag is returned.

    The Linux version of the same call :-

    #!perl
    use SOAP::Lite;
    print SOAP::Lite
    -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    -> TK_ADD_ENTRY('Neil Holmes','Greatest
    Hits','CD','9.99','www.proiv.com');

    Appears to run (no errors) but the application is not updated and no
    success flag is returned.

    Does anyone have some suggestions as to what might be causing this ? Or
    what I can do to try and track down the problem.

    Any suggestions very greatfully received.

    Many Thanks

    Neil
    , Nov 10, 2006
    #1
    1. Advertising

  2. J. Gleixner Guest

    wrote:
    > I am trying to make use of SOAP::LITE for calling Web Services from
    > Perl.
    >
    > I have Windows and Linux Installations.
    >
    > On Windows the following works fine :-
    >
    > #!/usr/local/bin/perl
    > use SOAP::Lite;
    > print SOAP::Lite
    > -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    > -> TK_ADD_ENTRY('Neil Holmes','Greatest Hits
    > Volume','CD','9.99','www.proiv.com');
    >
    > The data is added to the application behind the web services and a
    > success flag is returned.
    >
    > The Linux version of the same call :-
    >
    > #!perl

    ^^^^^^ Why isn't this the same as above?

    > use SOAP::Lite;
    > print SOAP::Lite
    > -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    > -> TK_ADD_ENTRY('Neil Holmes','Greatest
    > Hits','CD','9.99','www.proiv.com');
    >
    > Appears to run (no errors) but the application is not updated and no
    > success flag is returned.
    >
    > Does anyone have some suggestions as to what might be causing this ? Or
    > what I can do to try and track down the problem.


    Same versions of SOAP::Lite?

    How do you know there aren't any errors? I don't see any error handling
    in your example.

    Check the logs on neilvmes3's Web server.

    Add logging to the service.

    Adding +trace (see documentation) will show you what's being sent and
    received.
    J. Gleixner, Nov 10, 2006
    #2
    1. Advertising

  3. Guest

    Thanks for this. I have 0.60 on both Windows and Linux.

    I have added debug to my script :-

    #!perl -w
    use SOAP::Lite +trace =>
    qw(debug);
    print SOAP::Lite
    -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    -> TK_ADD_ENTRY("Neil Holmes",'Greatest
    Hits','CD','9.99','www.proiv.com');

    And the output is as follows :-

    SOAP::Transport::HTTP::Client::send_receive: POST
    http://neilvmes3:8082/ws/EcsAddEntry HTTP/1.1
    Accept: text/xml
    Accept: multipart/*
    Content-Length: 679
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "http://neilvmes3:8082/ws/EcsAddEntry"

    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><TK_ADD_ENTRY
    xmlns=""><parameters>Neil Holmes</parameters><c-gensym4
    xsi:type="xsd:string">Greatest Hits</c-gensym4><c-gensym6
    xsi:type="xsd:string">CD</c-gensym6><c-gensym8
    xsi:type="xsd:float">9.99</c-gensym8><c-gensym10
    xsi:type="xsd:string">www.proiv.com</c-gensym10></TK_ADD_ENTRY></SOAP-ENV:Body></SOAP-ENV:Envelope>
    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
    Connection: close
    Date: Mon, 13 Nov 2006 06:25:56 GMT
    Server: Jetty/5.1.10 (Linux/2.4.21-4.EL i386 java/1.5.0_03
    Content-Length: 413
    Content-Type: text/xml; charset=utf-8
    Client-Date: Mon, 13 Nov 2006 06:25:56 GMT
    Client-Response-Num: 1
    SOAPAction: ""

    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Error
    identifying Web Service: class
    com.northgateis.proiv.ws.servlet.WebServiceIdentificationException:
    Parameter ARTIST had 0 entry in the message part. Expecting
    1.</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

    This seems to be telling me that there is no value in the Parameter
    (the first value in the Method). How can this be ? I am particularly
    puzzled as there clearly is on Windows.

    Your advise is much appreciated.

    Many Thanks

    Neil
    , Nov 13, 2006
    #3
  4. J. Gleixner Guest

    wrote:
    > Thanks for this. I have 0.60 on both Windows and Linux.
    >
    > I have added debug to my script :-
    >
    > #!perl -w
    > use SOAP::Lite +trace =>
    > qw(debug);
    > print SOAP::Lite
    > -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    > -> TK_ADD_ENTRY("Neil Holmes",'Greatest
    > Hits','CD','9.99','www.proiv.com');
    >
    > And the output is as follows :-
    >
    > SOAP::Transport::HTTP::Client::send_receive: POST
    > http://neilvmes3:8082/ws/EcsAddEntry HTTP/1.1
    > Accept: text/xml
    > Accept: multipart/*
    > Content-Length: 679
    > Content-Type: text/xml; charset=utf-8
    > SOAPAction: "http://neilvmes3:8082/ws/EcsAddEntry"
    >
    > <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
    > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><TK_ADD_ENTRY
    > xmlns="">


    <parameters>Neil Holmes</parameters><c-gensym4
    > xsi:type="xsd:string">Greatest Hits</c-gensym4><c-gensym6
    > xsi:type="xsd:string">CD</c-gensym6><c-gensym8
    > xsi:type="xsd:float">9.99</c-gensym8><c-gensym10
    > xsi:type="xsd:string">www.proiv.com</c-gensym10>


    That looks odd.. Why "Neil Holmes" isn't a string.

    >
    > <SOAP-ENV:Envelope
    > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Error
    > identifying Web Service: class
    > com.northgateis.proiv.ws.servlet.WebServiceIdentificationException:
    > Parameter ARTIST had 0 entry in the message part. Expecting
    > 1.</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    >
    > This seems to be telling me that there is no value in the Parameter
    > (the first value in the Method). How can this be ? I am particularly
    > puzzled as there clearly is on Windows.
    >
    > Your advise is much appreciated.results


    Run it from the host that works and compare the output.

    Since you have a WSDL, you could also try using 'stubmaker.pl',
    which comes with SOAP::Lite, to create a class, which you can
    use or peruse it for any helpful code. See 'stubmaker' in
    perldoc SOAP::Lite.

    Maybe use SOAP::Data to set the properties for all of the attributes:
    my @params = (
    SOAP::Data->name( ARTIST => 'Neil Holmes' )->type( 'string' ),
    SOAP::Data->name( ALBUM => 'Greatest Hits')->type( 'string' ),
    etc..
    );

    print SOAP::Lite
    -> service('http://neilvmes3:8082/ws/EcsAddEntry?wsdl')
    -> TK_ADD_ENTRY( @params );

    Just a guess though. I have to do that when working with services
    written in .NET. (
    http://www.oreilly.com/catalog/progwebsoap/chapter/ch03.html )

    You will be able to get more SOAP::Lite specific help at
    http://tech.groups.yahoo.com/group/soaplite/
    J. Gleixner, Nov 13, 2006
    #4
    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. Saqib Ali

    SOAP:Lite Limitations re: https??

    Saqib Ali, Sep 12, 2003, in forum: Perl
    Replies:
    1
    Views:
    3,015
    Serge Dubrouski
    Sep 16, 2003
  2. Blaine Everingham

    SOAP::Lite

    Blaine Everingham, Dec 9, 2003, in forum: Perl
    Replies:
    0
    Views:
    708
    Blaine Everingham
    Dec 9, 2003
  3. Rushikesh Joshi
    Replies:
    0
    Views:
    425
    Rushikesh Joshi
    Aug 19, 2004
  4. Aaron Brady

    SQL, lite lite lite

    Aaron Brady, Dec 29, 2008, in forum: Python
    Replies:
    15
    Views:
    732
    Aaron Brady
    Jan 1, 2009
  5. droesler
    Replies:
    2
    Views:
    459
    droesler
    Aug 31, 2010
Loading...

Share This Page