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

Trouble with soap response message

Expand Messages
  • markbaxterus
    Hi All, I think this should be easy... but I m having trouble getting my SOAP::Lite client to decode a simple soap response message. My client receives the
    Message 1 of 1 , Dec 12, 2001
    • 0 Attachment
      Hi All,

      I think this should be easy... but I'm having trouble getting my
      SOAP::Lite client to decode a simple soap response message. My
      client receives the following:

      <?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:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Body>
      <namesp1:getNamesResponse xmlns:namesp1="urn:TestService">
      <m:response xmlns:m="http://temp.com/sd">
      <name>Frank</name>
      <name>Mary</name>
      </m:response>
      </namesp1:getNamesResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      I use Data::Dumper to look at the response and see:

      $VAR1 = bless( {
      'name' => 'Mary'
      }, 'response' );

      As you can see, 'Frank' was lost! :-(

      I expected to see both 'Frank' and 'Mary' in the output. A simple
      perl one-liner that illustrates an expected output:

      % perl -MXML::Simple -MData::Dumper -le \
      'print Dumper XMLin("<m:response xmlns:m=\"http:/temp.com/sd\"> \
      <name>Frank</name><name>Mary</name></m:response>")'

      $VAR1 = {
      'xmlns:m' => 'http:/temp.com/sd',
      'name' => [
      'Frank',
      'Mary'
      ]
      };

      BTW, the client code that makes the soap call:

      my $result = SOAP::Lite
      ->uri($URI)
      ->proxy($PROXY)
      ->getNames("request text")
      ->result;

      print Dumper $result;

      How do I properly configure my SOAP::Lite client to properly handle
      the received soap message?

      Thanks in advance,

      Mark

      P.S. My production environment is using SOAP::Lite 0.50. I did
      also
      test with 0.52, and the only difference was that the result
      was not "blessed".
    Your message has been successfully submitted and would be delivered to recipients shortly.