[英]SOAP returning invalid XML response
我正在使用Zend_Soap_Client對象將肥皂請求發送到另一個應用程序,這是它發送到服務器的XML格式:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urllocation" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:isAccountActive env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><param0 xsi:type="xsd:string">thisisatest</param0></ns1:isAccountActive></env:Body></env:Envelope>
我正在其他擁有的SOAP服務器上使用它,並且看起來工作正常,但是其中一個服務器返回了響應“ Invalid XML” ,這就是為什么我真的想知道為什么它不能單獨在該服務器上工作 。 任何想法將不勝感激。
其他詳細信息 :
我試圖注釋掉從服務器調用該方法的代碼,這里是代碼:
$client = new Zend_Soap_Client(null,
array(
'uri'=>'http://'.$user->customconfigs['alumniuri'],
'encoding'=>'UTF-8',
'location'=>'http://'.$user->customconfigs['alumnilocation']
)
);
echo "Location: {$user->customconfigs['alumnilocation']} - uri: {$user->customconfigs['alumniuri']}";
$alumniactive = $client->isAccountActive($token);
注釋后:
$alumniactive = $client->isAccountActive($token);
錯誤消失了。這與我其他應用程序中的代碼相同,並且從那里可以正常工作。
在長時間尋找這個問題的答案之后,我終於找到了問題……該代碼實際上位於一個joomla組件上,該組件使用的uri與我在位置上包含的字符“&”相同在xml標准上是非法的,然后從我的xml中刪除這些字符將導致SOAP服務器接受該請求為有效請求。 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.