|
From: Yunika S. <u05...@nu...> - 2008-06-11 14:03:32
|
Dear Mr/Ms,
I have a problem in using SOAP::Lite for my application. I would like to
ask for your help.
I want to build a Perl Web Client consuming WSDL (resulted from Apache
CFX Web Service).
The Web Service has a method called Test, which just returns the input.
Both output and input are of type string.
Here is my expected XML output:
EXPECTED OUTPUT:
<?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><Test <http://schemas.xmlsoap.org/soap/encoding/>
xmlns="http://test.test.test">TEXT_APPEAR</Test></SOAP-ENV:Body></SOAP-E
NV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Server: Jetty(6.1.6)
Content-Length: 206
Content-Type: text/xml
Client-Date: Wed, 11 Jun 2008 10:21:18 GMT
Client-Peer: 127.0.0.1:7650
SOAPAction: ""
I have tried following all the examples from the web but none of them
can give me the expected output xml. They give one extra element nested
around the input text.
My Perl Code (version 1):
use SOAP::Lite + trace => 'debug';
my $svc;
my $resp;
eval
{
$svc= SOAP::Lite
->service("http://localhost:8000/ <http://localhost:8000/> ");
$resp = $svc->Test('TEXT_APPEAR');
};
die "Got Error: $@" if($@);
OUTPUT:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance
<http://www.w3.org/1999/XMLSchema-instance> "
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/> "
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/> "
xmlns:xsd="http://www.w3.org/1999/XMLSchema
<http://www.w3.org/1999/XMLSchema> "
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP
-ENV:Body><Test <http://schemas.xmlsoap.org/soap/encoding/>
xmlns="http://test.test.test"><Test>TEXT_APPEAR</Test></Test></SOAP-ENV:
Body></SOAP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Server: Jetty(6.1.6)
Content-Length: 206
Content-Type: text/xml
Client-Date: Wed, 11 Jun 2008 10:21:18 GMT
Client-Peer: 127.0.0.1:7650
SOAPAction: ""
My Perl Code (version 2):
use SOAP::Lite + trace => 'debug';
my $svc;
my $resp;
eval
{
$svc= SOAP::Lite
->service("http://localhost:8000 <http://localhost:8000> ")
->proxy("http://localhost);
$resp = $svc->call(SOAP::Data->name('Test')
->attr ({'xmlns'=>'http://sth.sth.sth'})
=> "TEXT_APPEAR");
};
die "Got Error: $@" if($@);
OUTPUT:
<?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><Test <http://schemas.xmlsoap.org/soap/encoding/>
xmlns="http://test.test.test"><c-gensym3
<http://xml.ms.com/ns/msjava/greeter>
xsi:type="xsd:int">TEXT_APPEAR</c-gensym3></Greeter></SOAP-ENV:Body></SO
AP-ENV:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Server: Jetty(6.1.6)
Content-Length: 272
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 11 Jun 2008 10:29:25 GMT
Client-Peer: 127.0.0.1:7650
Could you help me to solve this issue?
Looking forward to your reply, I really thank you very much for your
kind attention.
Sincerely yours,
Yunika
|