消耗错误的Web服务:SOAP-ENV:Client内部服务器错误SoapDoc :: CheckNameSpace:错误的xml名称空间 [英] Error consuming Web Service: SOAP-ENV:Client Internal Server Error SoapDoc::CheckNameSpace: Wrong xml name space

查看:642
本文介绍了消耗错误的Web服务:SOAP-ENV:Client内部服务器错误SoapDoc :: CheckNameSpace:错误的xml名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不得不使用php(Zend Framework)中的Web服务,一切似乎都很好,但是当我想通过这样的try catch系统从服务器检索响应时:

I had to consume a Web Service in php (Zend Framework), everything seems to be fine, but when I wanted to retrieve the response from the server through a try catch system like this:

try{
    $response = $client->METHOD_TO_CONSUME(array(
            'DATA1' => $data1,
            'DATA2' => $data2
            )
        );
} catch (SoapFault $e) {
    Mage::log("Fault Message: " . $e->getMessage());
    Mage::log("Fault Code: " . $e->faultcode . ' ' . $e->faultstring . ' ' . $e->detail);
    Mage::log("Fault: " . (string) $e);
}

但是后来我得到了这个错误: SOAP-ENV:客户端 SOAP-ENV:客户端内部服务器错误SoapDoc :: CheckNameSpace:错误的xml名称空间

But then i got this error: SOAP-ENV:Client SOAP-ENV:Client Internal Server Error SoapDoc::CheckNameSpace: Wrong xml name space

首先,我认为这是WSDL的问题,但是后来我对SoapUi进行了一些测试,并且一切正常. 我不知道会发生什么?

First i thought it was a problem with the WSDL, but then i made some test with SoapUi, and everything worked perfectly. I don't have any idea what it could be happening?

推荐答案

经过数小时的调查,我解决了问题,问题是Soap版本,默认情况下,Zend使用Soap 1.2. 当我将其更改为1.1版本时,一切正常.

After hours of investigation, i solved it, the problem was the Soap version, by default, Zend uses Soap 1.2. When i changed it to the 1.1 version, everything works perfectly.

$params = array(
            'soapVersion' => SOAP_1_1
        );

 $client = new Zend_Soap_Client($url, $params);

我希望对此有所帮助:D

I hope help somebody with this :D

问候

这篇关于消耗错误的Web服务:SOAP-ENV:Client内部服务器错误SoapDoc :: CheckNameSpace:错误的xml名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆