2015-12-03 67 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 
相關問題