我正致力于在 php 5.3.6 中使用 .net 网络服务。我正在使用 SoapClient 类来建立连接。它不断失败,出现“SoapClient::__doRequest(): SSL: Connection reset by peer”和“SoapFault Object ( [message:protected] => Error Fetching http headers ".
这仅发生在方法/操作中。如果我使用 $response = $objClient->__getFunctions();它工作正常,我收到了没有问题的回复。
$objClient = new SoapClient("http://sample.idws.syndication.kbb.com/3.0/VehicleInformationService.svc?wsdl", array('trace' => 1, 'username' => 'xxxxxxx', 'password' => 'xxxxxxx', 'soap_version' => SOAP_1_2, 'exceptions' => true ));
PHP:启用 ssl soap 的 php 5.3.6。
操作系统:Ubuntu 11.10
最佳答案
过去几个月我一直面临类似的问题。 毕竟问题出在我使用非 wsdl 模式时 http://php.net/manual/en/soapclient.soapclient.php 有时,远程服务器不会响应 wsdl 位置的请求。
初始非wsdl模式
$soapx = new SoapClient(null,
array(
"trace" => true,
'cache_wsdl' => WSDL_CACHE_NONE,
'location' => 'http://remote_wsdl_url',
'uri' => 'http://necessary_uri',
'use' => SOAP_LITERAL,
'style' => SOAP_DOCUMENT,));
转为wsdl模式
$soapx = new SoapClient('http://remote_wsdl_url_turned_to_local',
array(
"trace" => true,
'cache_wsdl' => WSDL_CACHE_NONE,));
关于PHP 5.3.6 SoapClient::__doRequest():SSL:连接由对等方重置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10503886/