PDA

View Full Version : question about SOAP::LITE


norichung
03-10-2003, 01:44 PM
hello~~ I have a question about SOAP::LITE.

I have an orginal format to get xml data from server side.
But I need to use perl to be the client side to get those xml data~~
I have finished this perl program as below~~ Can anybody tell me anything wrong in my program? Or it is totally correct?

Thanks a lot.

My Perl program:
**********************************************
use SOAP::LITE;
my $ClassId = shift;

Print SOAP::LITE
->uri(urn:Example')
-> on-action(sub{sprintf '%s/%s', @_})
-> proxy(http://localhost/WebServices/getData/example.asmx')
-> getData(SOAL::ClassId => $ClassId->type('string')-> uri('urn:Example')
->result . "\n\n";
**********************************************

Orginal format:
Client Request:
**********************************************
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getData xmlns="http://localhost/WebServices/getData/">
<ClassId>string</ClassId>
</getData>
</soap:Body>
</soap:Envelope>

Server Response:
**********************************************
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getDataResponse xmlns="http://localhost/WebServices/getData/">
<getDataResult>
<ClassId>string</ClassId>
<EfDate>dateTime</EfDate>
<OP>decimal</OP>
</getDataResult>
</getDataResponse>
</soap:Body>
</soap:Envelope>
**********************************************