在PHP中读取简单的SOAP XML响应

I have looked for a solid working answer on this can't find one.

I am also New at SOAP, but very familiar with PHP.

I send out my SOAP request with CURL and my response comes back like this:

<?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>

I need to save the ->GetFeatureResult 'string' in a MySQL database without the XML. Everything I try returns blank. Here's what I'm using now:

$result = curl_exec($curl);
curl_close ($curl);

$resultXML = simplexml_load_string($result);


$item = $resultXML->GetFeatureResponse->GetFeatureResult;
查看全部
duanlinzhen7235
duanlinzhen7235
2013/08/02 19:56
  • xml
  • php
  • soap
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复