2015-12-03 66 views
1

我正在使用SOAP API,他们已经禁用了通常位于SOAP API的基本.asmx URL中的WSDL文档。在没有XML请求的情况下查看时,页面是404页面。现在,简单地实例化一个SoapClient失败($soap = new SoapClient($url);,错误是Premature end of data in tag html line 1)。我假设SoapClient的一个新实例试图从服务器检索WSDL。有没有办法解决这个问题?说'我想要使用SoapClient,但是在我告诉你将要使用的XML调用(连同所有必需的数据)之前,不要做任何调用''?在没有WSDL的情况下执行SoapClient __soapCall页面

编辑:我试过设置cache_wsdlWSDL_CACHE_NONE但我仍然得到这个错误。

回答

0

你必须以非WSDL模式下运行,因此SoapClient的你必须设置SoapClient的c'tor的WSDL参数设置为null

public SoapClient::SoapClient (mixed $wsdl [, array $options ]) 

初始化它通过以下方式

$client = new SoapClient(null, array('location' => http://your_domain/your_webservice", 
            'uri'  => "http://namespace_of_the_webservice/")); 

location...The location of the webservice 
uri...The namespace of the target webservice 
相关问题