SOAP返回无效的XML响应


SOAP returning invalid XML response

我使用Zend_Soap_Client对象向另一个应用程序发送Soap请求,这里是它发送到服务器的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服务器上使用它,并且似乎运行良好,但其中一个服务器返回了响应"无效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与我从包含字符"&"的位置获得的uri相同,这在xml标准中是非法的。从我的xml中删除这些字符将导致SOAP服务器接受有效的请求。:)