0

Hi I want to get value from given XML using simple_xml_string but its not working. XML is given below:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
    <eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
        <eb:From><eb:PartyId eb:type="urn:x12.org.IO5:01">webservices.sabre.com</eb:PartyId></eb:From>
        <eb:To><eb:PartyId eb:type="urn:x12.org.IO5:01">[email protected]</eb:PartyId></eb:To>
        <eb:CPAId>T198</eb:CPAId>
        <eb:ConversationId>[email protected]</eb:ConversationId>
        <eb:Service eb:type="SabreXML">Enhanced Air Book Request</eb:Service>
        <eb:Action>ErrorRS</eb:Action>
        <eb:MessageData>
            <eb:MessageId>1522435489615361760</eb:MessageId>
            <eb:Timestamp>2017-01-11T13:36:01</eb:Timestamp>
            <eb:RefToMessageId>mid:[email protected]</eb:RefToMessageId>
        </eb:MessageData>
    </eb:MessageHeader>
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
        <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">
            Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!-3319706757025363837!367706!0
        </wsse:BinarySecurityToken>
    </wsse:Security>
</soap-env:Header>
<soap-env:Body>
    <soap-env:Fault>
        <faultcode>soap-env:Client.InvalidSecurityToken</faultcode>
        <faultstring>Invalid or Expired binary security token: Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!-3319706757025363837!367706!0</faultstring>
        <detail>
            <StackTrace>
                com.sabre.universalservices.base.session.SessionException: errors.session.USG_INVALID_SECURITY_TOKEN
            </StackTrace>
        </detail>
    </soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>

From above xml I want to get faultCode node value But I am not able to get. Please help. I tried doing it but its not working.

 $feed = simplexml_load_string($response);
 $a = $feed->children('http://schemas.xmlsoap.org/soap/envelope/');
 var_dump($a->Fault->children('http://schemas.xmlsoap.org/soap/envelope/'));

Edited: Output I get is: Node no longer exists. But I want to get "soap-env:Client.InvalidSecurityToken" value.

5
  • 1
    Please expand on not working. What about it isn't working? Do you get an error? Do you get a value, but not the value you expect? Be specific. A problem well defined is half solved already. Commented Jan 12, 2017 at 3:17
  • Hi I had edited the question. Please help Commented Jan 20, 2017 at 16:07
  • Possible duplicate of How to read soap response xml in php Commented Jan 20, 2017 at 16:08
  • I already tried it. But its error. Commented Jan 20, 2017 at 16:33
  • Can't help if you don't want to share the error. And show exactly what you've tried. Be specific. Programming is Very, very detail oriented, and the specifics matter! Commented Jan 20, 2017 at 16:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.