0

我使用 Soap 进行 Web 服务调用,使用 PHP 进行整个操作。当我发送请求时,我得到的响应为341025COMPLETE. 但是当我为 Source 选择它时,它会打印它后面的 XML。

我们已将它传递给simplexml_load_string函数,但它未能为其生成对象。

会有什么问题simplexml_load_string?当同一个字符串被硬编码时,它在通过函数参数时工作,它失败了。

我得到的 XML 是:

<applicantscreening xmlns="https://www.example.com/xml/services/PSI"><response><reportid>00000</reportid><backgroundreport></backgroundreport><status>TEST</status></response></applicantscreening>
4

1 回答 1

0

我认为 xml 应该有问题。

你能提供xml字符串吗?

看一个简单的例子:

$string = <<<XML
<?xml version='1.0'?> 
<document>
<title>Forty What?</title>
<from>Joe</from>
<to>Jane</to>
<body>
 I know that's the answer -- but what's the question?
</body>
</document> 
XML;
$xml = simplexml_load_string($string);
print_r($xml);
于 2012-09-27T09:59:11.793 回答