2012-04-10 87 views
0

我试图打电话用PHP SoapClient的方法从Web服务,但出现以下错误::“此网页必须通过安全通道查看”

PHP Fatal error: Uncaught SoapFault exception: [HTTP] Forbidden (The page must be viewed over a secure channel (Secure Sockets Layer (SSL)). Contact the server administrator. ) 
Stack trace: 
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://www.ebri...', 'eBridge.WebServ...', 1, 0) 
#1 /var/application/test-control4-xml.php(284): SoapClient->__call('GetDocumentList', Array) 
#2 /var/application/test-control4-xml.php(284): SoapClient->GetDocumentList(Array) 
#3 {main} 

这里是我正在使用的代码:

$client = new SoapClient("https://www.ebridgeservices.com/ePortalService.asmx?WSDL"); 
$params= 
array('login' => $user, 
    'password' => $password, 
    'status'=>'All', 
    'docType'=>'850', 
    'fromDate'=> $from_date, 
    'toDate'=> $to_date,   
    'partner'=>'OurPartner') ;   
$results = $client->GetDocumentList($params);  
var_dump($results->GetDocumentListResponse); 

正如你可以看到我使用的是一个https地址,所以我不知道为什么我得到这个错误。难道我做错了什么?

+0

您需要证书....我想 – Baba 2012-04-10 18:51:05

回答

1

这个错误的一个常见原因是当你的PHP版本编译没有openssl库。简单地说,你的php无法通过https连接发出请求。

检查您的phpinfo()输出并查看您有openssl或任何类型的SSL支持。

+0

我确实已经启用了openssl支持。 – xena 2012-04-10 20:50:59

0

将WSDL提供给http://soapclient.com/soaptest.html表明该WSDL文件中的链接指向其服务器上的http:// URL,而不是https://。可能想要问他们对此的支持。

+0

感谢您的链接,我以前没有见过。我对这个肥皂的东西很新。我明白你的意思,现在你提到它,我可以在我的错误信息中看到http地址。我试过“支持”,并被告知他们不回答开发问题,所以仍然坚持现在。 – xena 2012-04-10 21:41:32