Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] receiving complex types perl S::L

Expand Messages
  • Duncan Cameron
    ... You need to iterate over the SOM object looking at each occurence of int. Something like (untested) for my $int ($som- valueof( //arr/int )) { print $int,
    Message 1 of 3 , Sep 19 4:02 PM
    • 0 Attachment
      On 2005-09-18 at 21:14:05 Vinit Samel wrote:

      >Hi
      >
      >Please find below the XML Request and Response. I
      >think its something with the way the int array is
      >deserialized - its taking 'int' type as a key and
      >hence only the last key:value pair is returned.
      >But I cant figure out where exactly I need to
      >manipulate the code in the SOAP:: Deserializer . both
      >decode_object and decode_value seem to work as
      >expected returning int values and type for the whole
      >int array.
      >
      >Let me know of what u think.
      >Thanks,
      >Vinit
      >-----------
      >
      >
      ><?xml version="1.0"
      >encoding="UTF-8"?><SOAP-ENV:Envelope
      >xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      >xmlns:SOAP-ENV="h
      >ttp://schemas.xmlsoap.org/soap/envelope/"
      >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      >xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><GetX
      >xmlns="http://www.xxxx.com/xxxx/xxxx"/></SOAP-ENV:Body></SOAP-ENV:Envelope>
      >
      >
      ><?xml version="1.0" encoding="utf-8"?><soap:Envelope
      >xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      >xmlns:xsd="http://www.w3.org/2001/XMLS
      >chema"><soap:Body><GetXResponse
      >xmlns="http://www.xxxx.com/xxxx/xxxx"><GetXResult><arr><int>0</int
      >><int>1</int><int>2</int><int>3</int><int>4</int><int>5</int><int>6</int><int>7</int><int>8</int><int>9</int></arr></GetXResult></GetXResponse></soap:Body></soap:Envelope>
      >
      >$VAR1 = {
      > 'arr' => {
      > 'int' => '9'
      > }
      > }

      You need to iterate over the SOM object looking at each occurence of int. Something like (untested)

      for my $int ($som->valueof('//arr/int')) {
      print $int, "\n";
      }

      See the sections of the docs regarding SOM to understand more about what is going on. Also, there are many posts in the list archives to do with this very topic.


      Duncan
    Your message has been successfully submitted and would be delivered to recipients shortly.