SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SOAP/XML Response Issues Parsing

    Hi,

    I received the following response from a SOAP API. I need to get the OK: number field parsed out as the number is the record number just inserted, and the OK means the record was added ok.

    I cant seem to be able to parse the number without it leaving < on the end of it.

    Can someone assist?

    this is the htmlentities output of the xml response. If I just echo the xml response it doesn't show all the xml tags and bits

    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlnssd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><addCustomerResponse xmlns="http://84.203.220.156/OperatorAPI"><s-gensym3 xsi:type="xsd:string">OK: 470</s-gensym3></addCustomerResponse></soap:Body></soap:Envelope>

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Posts
    67
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    how do you parse it right now?

    I think you can throw this in simplexml_load_string();

    retrieve the value of <s-gensym3></s-gensym3>

    and split on ':'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •