我已經找到了一個可靠的工作答案,找不到一個。在PHP中讀取一個簡單的SOAP XML響應
我也是SOAP新手,但對PHP很熟悉。
我送我的SOAP請求,捲曲我的回答回來這樣的:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetFeatureResponse xmlns="http://www.supportsite.com/webservices/">
<GetFeatureResult>**string**</GetFeatureResult>
</GetFeatureResponse>
</soap:Body>
</soap:Envelope>
我需要保存的 - 在一個MySQL數據庫> GetFeatureResult「串」沒有XML。我所嘗試的一切都會返回空白這裏是我現在使用的:
$result = curl_exec($curl);
curl_close ($curl);
$resultXML = simplexml_load_string($result);
$item = $resultXML->GetFeatureResponse->GetFeatureResult;
可能重複的:http://stackoverflow.com/questions/12485162/simplexml-load-string-will-not-閱讀肥皂響應與肥皂在標籤 – vee
不是重複 - 我正在尋找一個具體問題的解決方案...該職位是模糊的問題,並沒有提出一個目標。因此,我收到的答案是在我的特定問題更有幫助 – Clandestine8