Answer the question
In order to leave comments, you need to log in
How to parse Soap response?
Please help me get data from this Soap response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<cred:receiveCreditDecision
xmlns=""
xmlns:cred="http://b2b.instantloan.com/CreditDecision">
<decision>
<amount>0</amount>
<creditTerm>15</creditTerm>
<decision>1</decision>
<downPayment></downPayment>
<environmentCode>KREDBRKMNG_TEST</environmentCode>
<product>PKP285_М6_36</product>
<reference>2-1BVB7NYF</reference>
<referenceKB></referenceKB>
<source>OTPBank</source>
<monthlypaymentamount>0</monthlypaymentamount>
<CreditAmount>0</CreditAmount>
<FullAgentServicesAmount>0</FullAgentServicesAmount>
<AgentServicesAmount>0</AgentServicesAmount>
<limitCartOfGoods>100000</limitCartOfGoods>
</decision>
</cred:receiveCreditDecision>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
$xml = simplexml_load_string($soap_response);
$xml->registerXPathNamespace('SOAP-ENV', 'http://schemas.xmlsoap.org/soap/envelope/');
$xml->registerXPathNamespace('cred', 'http://b2b.instantloan.com/CreditDecision');
$xml_resp = $xml->xpath('//cred:receiveCreditDecision/decision');
$otp_result_parse_array = json_decode(json_encode($xml_resp[0]), true);
Answer the question
In order to leave comments, you need to log in
why such perversions when there are extensions for php?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question