-1

I am using phpcURL to handle the SOAP request method and I got the following response. Looks like it's little different and complex from what I have read and search on google for handling the xml response using php (simpleXML & DOM).

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
    <as:QueryResultMsg 
        xmlns:as="http://www.as.com/as" 
        xmlns:ac="http://www.ac.com/ac" 
        xmlns:cs="http://www.cs.com/cs">
        <ResultHeader>
            <cs:Version>1</cs:Version>
            <cs:Result>Success.</cs:Result>
        </ResultHeader>
        <QueryResult>
            <as:List>
                <as:Key>4000020023983</ars:Key>
                <as:Result>
                    <ac:Type>TYPE</ac:Type>
                    <ac:TypeName>Account_Type_Name</ac:TypeName>
                    <ac:TotalAmount>200000</ac:TotalAmount>
                    <ac:Detail>
                        <ac:InstanceID>03610</ac:InstanceID>
                        <ac:Amount>200000</arc:Amount>
                        <ac:InitialAmount>0</arc:InitialAmount>
                    </ac:Detail>
                </as:Result>
                <as:AccountCredit>
                    <as:CreditAmount>5000</as:CreditAmount>
                </as:AccountCredit>
            </as:List>
        </QueryResult>
    </as:QueryResultMsg>
</soapenv:Body>

If you can share me how to display following TagElements:- 1) TypeName 2) TotalAmount 3) InitialAmount 4) CreditAmount

And which one is better parser SimpleXml of Dom in this case.

Megamind
  • 47
  • 1
  • 8

1 Answers1

0

You can user simplexml_load_string in PHP

you can refer this issue PHP Parsing SOAP response

Community
  • 1
  • 1