|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-01-19 11:02 UTC] lampacz at gmail dot com
Description: ------------ Connecting to SAP https endpoint(https://sap_ip_adress:1802/long_url). After calling soap function (soapclient->function()) getting "Could not connect to host". PHP version 5.3.3-7+squeeze8 works ok PHP version 5.4, 5.6.3 doesn't work Test script: --------------- $oSC = new SoapClient('sap.wsdl', array( 'local_cert' => 'sap.crt', 'location' => 'https://sap_address:8102/sap_url/1.0', 'user_agent' => 'PHP WS', 'cache_wsdl' => WSDL_CACHE_NONE, 'trace' => true, 'exceptions' => true, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'soap_version' => SOAP_1_1 )); $oSC->getInfo(); Expected result: ---------------- Result from getInfo() function Actual result: -------------- Could not connect to host PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Can be fixed with this workaround. Need to add stream context param to SoapClient. $client = new SoapClient("https://IP:443/sdk/vimService.wsdl", array( "trace" => 1, "location" => "https://IP:443/sdk/", 'exceptions' => 1, "stream_context" => stream_context_create( array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, ) ) ) ) );Of course tried this solution but doesn't work. $oSC = new SoapClient('sap.wsdl', array( 'local_cert' => 'sap.crt', 'location' => 'https://sap_address:8102/sap_url/1.0', 'user_agent' => 'PHP WS', 'cache_wsdl' => WSDL_CACHE_NONE, 'trace' => true, 'exceptions' => true, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'soap_version' => SOAP_1_1, 'stream_context' => stream_context_create( array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, ) ) ) ));This is my production config for https remote air ticket service, and it is working without any cert, just with pass phrase. $soapParams = [ 'login' => $this->request['user'], 'password' => $this->request['password'], 'trace' => true, 'connection_timeout' => 10, 'default_socket_timeout' => 10, "exceptions" => true, 'soap_version' => SOAP_1_1, 'cache_wsdl' => WSDL_CACHE_NONE, 'location' => 'https://link/', "stream_context" => stream_context_create( [ 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, ] ] ) ];