2012-06-20 24 views
0

如何使用SimpleXML將SOAP響應轉換爲php數組?使用SimpleXML將SOAP響應轉換爲關聯數組

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <soap:Header> 
    <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill"> 
     <eWAYCustomerID>9******5</eWAYCustomerID> 
     <Username>ac****@si****.com.sand</Username> 
     <Password>*******</Password> 
    </eWAYHeader> 
    </soap:Header> 
    <soap:Body> 
    <CreateRebillCustomerResponse xmlns="http://www.eway.com.au/gateway/rebill/manageRebill"> 
     <CreateRebillCustomerResult> 
     <Result>Success</Result> 
     <ErrorSeverity /> 
     <ErrorDetails /> 
     <RebillCustomerID>60066328</RebillCustomerID> 
     </CreateRebillCustomerResult> 
    </CreateRebillCustomerResponse> 
    </soap:Body> 
</soap:Envelope> 
+0

感謝您糾正帖子。 –

+0

你能解釋一下你是如何得到這個以及你打算如何處理它的,因爲我在這裏嗅到了「不正確使用技術」的糟糕情況 –

+0

我正在開發一個使用Eway支付網關API的應用程序。我在php中使用CURL發送SOAP請求後得到了這個。這是作爲迴應。 –

回答

3

你可能想看看SoapClient類呢?這將節省麻煩。