Testing https requests with WSClient

Tuesday, June 24, 2008

If any case you found your WSClient fails in sending https request, you can use the "https://6ec2.dyndns.org/samples/wsdl_mode/wsdl_11_service.php" service to test whether the problem is in your WSF/PHP installation or something else. What you need to do is edit the samples/wsdl_mode/wsdl_11_client.php so that your WSClient constructor have the following value.


$client = new WSClient(array("wsdl"=>"sample_wsdl_11.wsdl",
"to" => "https://6ec2.dyndns.org/samples/wsdl_mode/wsdl_11_service.php",
"CACert" => "server.crt"
));

Use the approach mentioned in this blog post to generate the above server.crt certifcate.

Then run the sample in the command prompt or shell
php wsdl_11_client.php and test whether the response comes as expected. if not you have to check the wsf/php instatllatioin steps again.

No comments: