douyan1927 2012-08-22 08:47 采纳率: 0%
浏览 47
已采纳

Zend_Soap_Client得到“看起来我们没有XML文档”错误

I am trying to access a Web Service (SOAP) from a provider. I have not control on the server response. For this I am using, Zend_Soap_Client passing the WDSL and options in the constructor, I can do getFunctions, but when try to access the first Soap method I get

[Sender] looks like we got no XML document

After looking around and checking the answer I get from the server with soapUI I see that the answer is missing the XML declaration:

<?xml version="1.0" encoding="XXXXXXX"?>

So, is there aby way to make the Zend_Soap_Client omit the XML validation based in the XML declaration? Assuming that the lacking of the declaration is my problem.

Here is the code I use for this:

private $_connection_settings = array('login' => self::API_user, 'pwd' => self::API_password, 'key'=> self::API_Key);


private static $CONNEXION_PARAMS = array(                                            
                                        'soap_version'   => SOAP_1_1,
                                        'encoding'      => 'UTF-8'
                                     );

...

//somewhere in my code: 

$client = new Zend_Soap_Client('http://server_URL?wsdl', self::$CONNEXION_PARAMS);
$response = $client->fistSoapMethod($this->_connection_settings);            

And response is not assigned.

Thanks!

  • 写回答

1条回答 默认 最新

  • duanliao5995 2012-08-24 15:13
    关注

    No other warnings/errors from your code besides the SOAP Fault?

    Not sure it is the WSDL. Can always try validating the WSDL using an online tool.

    Have you used getLastResponse() and getLastRequest() methods? Sounds like you might be sending some garbage at the start of your request. Another thing I always do when testing is turn off WSDL caching.

    ini_set("soap.wsdl_cache_enabled", 0);

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?