2012-08-17 49 views
0

我正在使用ZF2-RC2並嘗試在soap中執行web服務 我成功通過強制讓我的wsdl工作頭,但對於服務器的一部分,它不工作,我得到一個錯誤500告訴我ZF2 PHP警告:SoapServer :: SoapServer():I/O警告:未能加載外部實體

PHP的警告:SoapServer時:: SoapServer的():I/O警告:未能加載外部實體

錯誤是當我做 - > handle()部分。

if(isset($_GET['wsdl'])) { 
    header ("Content-Type:text/xml"); 
    $autodiscover = new AutoDiscover(); 
    $autodiscover->setClass('WsClass') 
       ->setUri('http://adresse/ws/?wsdl'); 
    echo $autodiscover->toXml(); 
} else { 

    // pointing to the current file here   
    $soap = new Server('http://adresse/ws/?wsdl'); 
    $soap->setClass('WsClass'); 
    $soap->handle(); 
} 
exit; 

有人可以幫助我嗎?

回答

0

您不應將AutoDiscover對象中的URI設置爲wsdl。嘗試

$autodiscover->setClass('WsClass') 
      ->setUri('http://adresse/ws'); 

此外,在服務器的構造函數刪除/:

$soap = new Server('http://adresse/ws?wsdl');