This question already has an answer here:
- Parsing XML with multiple namespaces 1 answer
Hi i am getting soap xml response given below in my API call using PHP but i am not able to parse it so i can store into database properly.
<?xml version="1.0" encoding="UTF-8"?>
<ns2:processedSalesOrderMessage xmlns:ns2="api.supplieroasis.com" xmlns:ns3="api.supplieroasis.com/retailorder" xmlns:ns4="https://mpc.overstock.com/jms/sofs">
<ns2:processedSalesOrder>
<ns2:salesChannelOrderNumber>131415</ns2:salesChannelOrderNumber>
<ns2:salesChannelName>OFF_NETWORK</ns2:salesChannelName>
<ns2:orderDate>2015-06-05T09:19:18.000-06:00</ns2:orderDate>
<ns2:sofsCreatedDate>2015-06-05T09:19:20.000-06:00</ns2:sofsCreatedDate>
<ns2:warehouseName>
<ns2:code>1969</ns2:code>
</ns2:warehouseName>
<ns2:shipToAddress>
<ns2:contactName>Test Order1</ns2:contactName>
<ns2:address1>1969 S. Los Angeles St</ns2:address1>
<ns2:city>Los Angeles</ns2:city>
<ns2:stateOrProvince>CA</ns2:stateOrProvince>
<ns2:postalCode>90011</ns2:postalCode>
<ns2:countryCode>US</ns2:countryCode>
<ns2:phone>213-745-2023</ns2:phone>
</ns2:shipToAddress>
<ns2:returnAddress>
<ns2:contactName>1969</ns2:contactName>
<ns2:address1>1969 S. Los Angeles St</ns2:address1>
<ns2:city>Los Angeles</ns2:city>
<ns2:stateOrProvince>CA</ns2:stateOrProvince>
<ns2:postalCode>90011</ns2:postalCode>
<ns2:countryCode>US</ns2:countryCode>
<ns2:phone>213-745-2023</ns2:phone>
</ns2:returnAddress>
<ns2:shippingSpecifications>
<ns2:isThirdPartyBilling>false</ns2:isThirdPartyBilling>
<ns2:isSignatureRequired>false</ns2:isSignatureRequired>
<ns2:isDeclaredValueRequired>false</ns2:isDeclaredValueRequired>
<ns2:smallParcelShipment>
<ns2:shippingServiceLevel>
<ns2:code>GROUND</ns2:code>
</ns2:shippingServiceLevel>
</ns2:smallParcelShipment>
<ns2:isExport>false</ns2:isExport>
</ns2:shippingSpecifications>
<ns2:branding />
<ns2:orderFulfillment>ALLOW_PARTIAL_FILL</ns2:orderFulfillment>
<ns2:orderId>47511</ns2:orderId>
<ns2:status>PROCESSING</ns2:status>
<ns2:retailChannelCode>OFF_NETWORK_1501</ns2:retailChannelCode>
<ns2:retailOrderNumber>131415</ns2:retailOrderNumber>
<ns2:actionRequired>true</ns2:actionRequired>
<ns2:processedSalesOrderLine>
<ns2:salesChannelLineId>1</ns2:salesChannelLineId>
<ns2:salesChannelLineNumber>1</ns2:salesChannelLineNumber>
<ns2:partnerSKU>ALDO_5225_37_48R</ns2:partnerSKU>
<ns2:barcode>ALDO_5225_37_48R</ns2:barcode>
<ns2:salesChannelSKU>ALDO_5225_37_48R</ns2:salesChannelSKU>
<ns2:quantity>1</ns2:quantity>
<ns2:itemPrice>0.00</ns2:itemPrice>
<ns2:lineId>54600</ns2:lineId>
<ns2:itemId>211437</ns2:itemId>
<ns2:itemName>Ferrecci Men's 'Zonettie' 2-piece Navy Suit</ns2:itemName>
<ns2:lineStatus>PROCESSING</ns2:lineStatus>
<ns2:unitCost>0.00</ns2:unitCost>
<ns2:unitCostCurrencyCode>USD</ns2:unitCostCurrencyCode>
</ns2:processedSalesOrderLine>
</ns2:processedSalesOrder>
</ns2:processedSalesOrderMessage>
I am getting this in API response as string? Can any one help me please how it can be parse into PHP ???