Php 从SOAP响应XML中提取
我收到一个API的响应,目前我正在用它来做这件事Php 从SOAP响应XML中提取,php,xml,soap,Php,Xml,Soap,我收到一个API的响应,目前我正在用它来做这件事 $xml = simplexml_load_string($serverResponse); print_r($xml->children('SOAP-ENV', true)->Body->children('urn:xtk:queryDef')->asXML()); 这让我想到以下几点 <ExecuteQueryResponse xmlns="urn:xtk:queryDef" SOAP-ENV:encoding
$xml = simplexml_load_string($serverResponse);
print_r($xml->children('SOAP-ENV', true)->Body->children('urn:xtk:queryDef')->asXML());
这让我想到以下几点
<ExecuteQueryResponse xmlns="urn:xtk:queryDef" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><pdomOutput xsi:type="ns:Element" SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
<recipient account="7777777777"/></pdomOutput>
</ExecuteQueryResponse>
我试图做的是提取帐户的值。我将如何获得该值
谢谢尝试使用XPath。请参阅和。您是否将内置的SoapClient与WSDL一起使用?你是如何得到回应的?在这种情况下不需要解析XML。请尝试使用XPath。请参阅和。您是否将内置的SoapClient与WSDL一起使用?你是如何得到回应的?在这种情况下,不需要解析XML。