编程语言
首页 > 编程语言> > PHP 5.3.6 SoapClient :: __ doRequest():SSL:由对等方重置连接

PHP 5.3.6 SoapClient :: __ doRequest():SSL:由对等方重置连接

作者:互联网

我正在努力在php 5.3.6中使用.net web服务.我正在使用SoapClient类来建立连接.它继续失败“SoapClient :: __ doRequest():SSL:连接由对等重置”和“SoapFault对象([消息:受保护] =>错误获取http标头”.

这种情况仅发生在方法/操作中.如果我使用$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:php 5.3.6启用了ssl soap.
操作系统: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,soap,web-services,soap-client
来源: https://codeday.me/bug/20190709/1415437.html