【发布时间】:2017-11-30 11:06:40
【问题描述】:
我使用 curl 调用了肥皂服务器,我得到了这样的响应:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GenerateAuthPasswordResponse xmlns="NepalTelecom.AuthGateway">
<GenerateAuthPasswordResult>abcd-efgh</GenerateAuthPasswordResult>
<ResultCode>1</ResultCode>
</GenerateAuthPasswordResponse>
</soap:Body>
</soap:Envelope>
当我尝试将soap xml解析为:
$response = $this->SoapModel->soapCall($xml , $this->vas_wsdl_url);
$obj = simplexml_load_string($response);
echo $obj;die();
[注意:其中 $response 是上述soap xml中提供的soap响应]
我得到 $obj 作为这样的错误:
Severity: Warning
Message: simplexml_load_string(): namespace warning : xmlns: URI NepalTelecom.AuthGateway is not absolute
请任何机构帮助解决此问题。 提前谢谢你。
【问题讨论】:
-
参考此链接。这可能对你有帮助。 stackoverflow.com/questions/4194489/how-to-parse-soap-xml
-
我已经尝试过了,但无法获得所需的响应。请如果您可以为我上面提供的soap xml提供数组中的响应。