Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP SoapClient unable to work with https WS

i have a problem working with PHP SoapClient with a WS (WSDL) that contains https. my PHP version is 5.2.5. before you ask, yes, i am using PHP's Soap and openSSL extentions.

the URL i am trying to reach is: https://id3check.gb.co.uk/gbportalinternational/aspx/id3check_1b.asmx?WSDL

the code i am using:

$url = "https://id3check.gb.co.uk/gbportalinternational/aspx/id3check_1b.asmx?WSDL";
$options["connection_timeout"] = 25;  
$options["location"] = $url;

$client = new SoapClient($url,$options);

it fails while constructing the SoapClient, and i get the following error:

Warning: SoapClient::SoapClient(https://id3check.gb.co.uk/gbportalinternational/aspx/id3check_1b.asmx?WSDL): failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\MY-DEV-FOLDER\index.php on line 42 Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "https://id3check.gb.co.uk/gbportalinternational/aspx/id3check_1b.asmx?WSDL" in C:\MY-DEV-FOLDER\index.php on line 42 Exception thrown - SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://id3check.gb.co.uk/gbportalinternational/aspx/id3check_1b.asmx?WSDL'

can anyone tell me what is the problem?

thanks

Erez

like image 745
Erez Avatar asked Dec 10 '22 13:12

Erez


1 Answers

You will need to have OpenSSL enabled in PHP to be able to retrieve content over https.

Uncomment this line in php.ini

extension=php_openssl.dll

Look for the openssl section in your phpinfo():

OpenSSL support => enabled  
OpenSSL Library Version => OpenSSL 0.9.8k 25 Mar 2009
OpenSSL Header Version => OpenSSL 0.9.8k 25 Mar 2009
like image 180
Eron Villarreal Avatar answered Dec 26 '22 06:12

Eron Villarreal