Hi There,

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 &lt;,&gt; and &#xd; 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="">&lt;?xml version=&quot;1.0&quot; encoding= +&quot;UTF-8&quot;?&gt;&#xd; &lt;UDSObjectList&gt;&#xd; &lt;UDSObject&gt;&#xd; &lt;Handle&gt;pcat:400004&lt;/Handle&gt;&#xd; &lt;Attributes&gt;&#xd; &lt;Attribute DataType=&quot;2002&quot;&gt;&#xd; &lt;AttrName&gt;sym&lt;/AttrName&gt;&#xd; &lt;AttrValue&gt;Hosted Solutions Support&lt;/AttrValue&gt;&#xd; &lt;/Attribute&gt;&#xd; &lt;Attribute DataType=&quot;2002&quot;&gt;&#xd; &lt;AttrName&gt;description&lt;/AttrName&gt;&#xd; &lt;AttrValue/&gt;&#xd; &lt;/Attribute&gt;&#xd; &lt;/Attributes&gt;&#xd; &lt;/UDSObject&gt;&#xd; &lt;/UDSObjectList&gt;&#xd; &#xd; </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:

<?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>
Thanks,

fujiman

In reply to Why SOAP::Lite Method call returned partially XML formatted? by fujiman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.