0

How do I read this soap response and echo the values of subid and points. Here is the response

    <?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:zuku">
    <SOAP-ENV:Body>
        <ns1:showloyaltypointsResponse xmlns:ns1="http://tempuri.org">
            <return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:subpoints[1]">
                <item xsi:type="tns:subpoints">
                    <subid xsi:type="xsd:integer">618341</subid>
                    <points xsi:type="xsd:string">0</points>
                </item>
            </return>
        </ns1:showloyaltypointsResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And here is my php code

    $result = $client ->call('showloyaltypoints',array("subid" =>$subid,"username" =>"$username", "password" =>"$password"));

echo $client->response;
Wanjala Alex
  • 141
  • 2
  • 13

1 Answers1

0

I found out the solution by converting it to an array first.

https://stackoverflow.com/a/42311833/7042343

Wanjala Alex
  • 141
  • 2
  • 13