fujiman has asked for the wisdom of the Perl Monks concerning the following question:
I using SOAP::Lite to access Web Service method call, the method call is basically a query that returns the data in XML or complexType. However, when I make the method call and using SOAP::Lite trace, partial data returned do not seem to be deserialized. This causes me not to be able to use $som->valueof() function to retrieve the return values. Does anyone know why this is so? Or any ideas on how to debug this?
Here is trace code that illustrates the incorrect return values where the <, > and return are replaced with <,> and 
 entities, respectively.
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:wsdlsoap="h +ttp://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.ap +ache.org/xml-soap" xmlns:namesp7="test" soap:encodingStyle="http://sc +hemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap. +org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xml +ns:impl="$uri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd=" +http://www.w3.org/2001/XMLSchema"><soap:Body><namesp7:doSelect xmlns: +namesp7="test"><sid xsi:type="xsd:int">1041754813</sid><objectType xs +i:type="xsd:string">pcat</objectType><whereClause xsi:type="xsd:strin +g">sym like 'Hosted%'</whereClause><maxRows xsi:type="xsd:int">1</max +Rows><attributes><string xsi:type="xsd:string">sym</string><string xs +i:type="xsd:string">description</string></attributes></namesp7:doSele +ct></soap:Body></soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Sun, 14 Sep 2008 03:11:44 GMT Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Client-Date: Sun, 14 Sep 2008 03:11:39 GMT Client-Peer: 65.120.87.83:8180 Client-Response-Num: 1 <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envel +ope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:// +www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <doSelectResponse xmlns="test"> <doSelectReturn xmlns=""><?xml version="1.0" encoding= +"UTF-8"?>
 <UDSObjectList>
 <UDSObject>
 <Handle>pcat:400004</Handle>
 <Attributes>
 <Attribute DataType="2002">
 <AttrName>sym</AttrName>
 <AttrValue>Hosted Solutions Support</AttrValue>
 </Attribute>
 <Attribute DataType="2002">
 <AttrName>description</AttrName>
 <AttrValue/>
 </Attribute>
 </Attributes>
 </UDSObject>
 </UDSObjectList>
 
 </doSelectReturn> </doSelectResponse> </soapenv:Body> </soapenv:Envelope> SOAP::Transport::HTTP::Client::send_receive: POST <here is the WSDL ad +dress I replaced> HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap User-Agent: SOAP::Lite/Perl/0.710.05 Content-Length: 670 Content-Type: text/xml; charset=utf-8 SOAPAction: "" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:wsdlsoap="h +ttp://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.ap +ache.org/xml-soap" xmlns:namesp7="test" soap:encodingStyle="http://sc +hemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap. +org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xml +ns:impl="http://www.ca.com/UnicenterServicePlus/ServiceDesk" xmlns:xs +i="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://s +chemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/ +XMLSchema"><soap:Body><impl:logout><sid xsi:type="xsd:int">1041754813 +</sid></impl:logout></soap:Body></soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Sun, 14 Sep 2008 03:11:44 GMT Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Client-Date: Sun, 14 Sep 2008 03:11:39 GMT Client-Peer: 65.120.87.83:8180 Client-Response-Num: 1
The odd thing is when I print the result SOAP::Lite method call, results print correctly.
my $result = $service->call($method => @params); print $result->result;
Printed output:
Thanks,<?xml version="1.0" encoding="UTF-8"?> <UDSObjectList> <UDSObject> <Handle>pcat:400004</Handle> <Attributes> <Attribute DataType="2002"> <AttrName>sym</AttrName> <AttrValue>Hosted Solutions Support</AttrValue> </Attribute> <Attribute DataType="2002"> <AttrName>description</AttrName> <AttrValue/> </Attribute> </Attributes> </UDSObject> </UDSObjectList>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why SOAP::Lite Method call returned partially XML formatted?
by Anonymous Monk on Sep 14, 2008 at 04:40 UTC | |
by Anonymous Monk on Sep 14, 2008 at 04:45 UTC | |
by fujiman (Novice) on Sep 15, 2008 at 19:09 UTC | |
by Anonymous Monk on Sep 16, 2008 at 06:52 UTC |