Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 5.3.6 SoapClient::__doRequest(): SSL: Connection reset by peer

I'm working on consuming a .net web service in php 5.3.6. I'm using SoapClient class to make the connection. It is keep on failing with "SoapClient::__doRequest(): SSL: Connection reset by peer" and "SoapFault Object ( [message:protected] => Error Fetching http headers ".

This is happening only for the Methods/Operations. If i use $response = $objClient->__getFunctions(); and it is working fine and I'm getting the responses with out issue.

$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 with ssl soap enabled.
OS: Ubuntu 11.10

like image 787
user1382774 Avatar asked Nov 14 '22 05:11

user1382774


1 Answers

i ve been facing a similar issue the past few months. it turned out afterall that the problem was when i used non-wsdl mode http://php.net/manual/en/soapclient.soapclient.php occassionally the remote server wouldn't respond on the request of the location of the wsdl.

initial non-wsdl mode

    $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,));

turned to wsdl mode

    $soapx = new SoapClient('http://remote_wsdl_url_turned_to_local',
            array(
        "trace" => true,
        'cache_wsdl' => WSDL_CACHE_NONE,));
like image 190
nikolas Avatar answered Nov 16 '22 03:11

nikolas