SOAP::LITE

N

neil.holmes

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
 
J

J. Gleixner

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

neil.holmes

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
 
J

J. Gleixner

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="">

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/
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top