我正在使用本机soapclient()来调用WSDL但我不能使用simplexml来解析结果.我一直都会收到错误:
Warning: simplexml_load_string() [function.simplexml-load-string]:
Entity: line 1: parser error : Extra content at the end of the document
这看起来不像命名空间问题,我已经尝试过网站上其他地方提到的补丁来从输入字符串中删除冒号.
编辑:
谢谢,戈登
你是对的.该服务器是使用数据集的Microsoft站点.
如果我将soap客户端声明为trace设置为true:
$soapClient = new soapclient($this->wsdlUrl,array('trace'=>true));
然后从响应中检索原始XML:
$soapResult = $soapClient->GetScheduledSectors();
$responseXml = $soapClient->__getLastResponse();
$xml = simplexml_load_string($responseXml, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/");
然后我得到:
SimpleXMLElement Object
(
[Body] => SimpleXMLElement Object
(
)
)
响应XML标头和第一个标签如下所示: