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

Help parsing soap response

Expand Messages
  • bridg_addikt
    I am trying to parse the soap response that I received and having trouble doing that. I am trying to extract the code from the response below. $code =
    Message 1 of 2 , Aug 15, 2003
    • 0 Attachment
      I am trying to parse the soap response that I received and having
      trouble doing that. I am trying to extract the "code" from the
      response below.

      $code = $res->{createResponse}->{createResult}->{error}->{code};
      print "$code\n";

      I'm ending up with "Use of uninitialized value in print at ..."
      What am I doing wrong?

      <?xml version="1.0" encoding="utf-8"?>
      <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
      <createResponse xmlns="http://proctor.nasd.com/webservices/">
      <createResult>

      <error>
      <severity>HIGH</severity>
      <type>DATA_ERR</type>
      <code>VENDOR_NOT_VALID</code>
      <description>VENDOR_NOT_VALID: ERROR CODE MESSAGE NOT AVAILABLE!!
      (Vendor id sub
      mitted with the request is not valid or does not exist.)</description>
      </error>

      <submitter>TRACER</submitter>
      <submitterTransactionId>1000</submitterTransactionId>
      </createResult>
      </createResponse> </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    • Duncan Cameron
      ... You have one too many levels of hash references. You don t want to reference createResponse as that is what SOAP::Lite returns. Try running under debug and
      Message 2 of 2 , Aug 15, 2003
      • 0 Attachment
        On 2003-08-15 19:18:00 bridg_addikt <unixrulez@...> wrote:

        >I am trying to parse the soap response that I received and having
        >trouble doing that. I am trying to extract the "code" from the
        >response below.
        >
        >$code = $res->{createResponse}->{createResult}->{error}->{code};
        >print "$code\n";
        >
        >I'm ending up with "Use of uninitialized value in print at ..."
        >What am I doing wrong?
        You have one too many levels of hash references. You don't want to reference
        createResponse as that is what SOAP::Lite returns.

        Try running under debug and dump $res

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