0
votes

I'm trying to access WSDL(Web Service Definition Language) file using SoapClient() of PHP. I found that WSDL file is authenticated. I tried with passing credentials on an array by another parameter and active SSL on my server, still I'm getting an error.

Here is the code I'm using:

$client = new SoapClient("https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl",array("trace" => "1","Username" => "username","Password" => "password"));

Here is the error I'm getting:

Warning: SoapClient::SoapClient(https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl) [soapclient.soapclient]: failed to open stream: Connection timed out in PATH_TO_FILE on line 80

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl" in PATH_TO_FILE on line 80

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl' : failed to load external entity "https://webservices.chargepointportal.net:8081/coulomb_api_1.1.wsdl" in PATH_TO_FILE:80 Stack trace: #0 /home2/wingstec/public_html/widget/API/index.php(80): SoapClient->SoapClient('https://webserv...', Array) #1 {main} thrown in PATH_TO_FILE on line 80

It seems that error says file not exist at the path we given but when we run that path directly on browser then we're getting that file

Can anyone help me to figure out what the exactly problem is?

1
Hi Initall, Please don't close the question as I'm just sharing an issue what I'm getting. Its important for me to get solution as I can't figure out the exact issue. Can you tell me why I'm getting this error or where I'm going wrong with the process.Dhaval
@Dhaval This question doesn't even belong here, but at StackOverflow. If you disagree with their closing of it, then petition to have it re-opened over there. Don't just go posting it other places hoping to trick someone into addressing it; we'd only migrate it over to SO anyway. [Voting to close.]Su'

1 Answers

1
votes

First make sure you have the right to access website from your hosting account or server - check first if you can access a http webservice (without the s). If not, check if allow_url_fopen is set to true in php.ini.

Then, if you are trying to establish a https connection, you need a local certificate. See if you can add one and instantiate your Soap object using something like

new SoapClient($wsdl, array('local_cert' => $pathToLocalCert));