Problem consuming a Java WS over https

cdiscla.inwind.it's picture

Hello, i'm trying to consume a WS over https on a port different from 80 and 443; here is the code:

$client = new WSClient(array("wsdl"=>"https://host:5678/...service?WSDL"));

$proxy = $client->getProxy();

$arr_param=array(....);

$return_val = $proxy->method_name($arr_param);

var_dump($return_val);

$return_val is always null. What am i doing wrong? Thanks in advance and greetings !

me.toshiro.it's picture

I Think you have to add:

I Think you have to add: "CACert"=>"cert.pem" to your WSClient definition.

If for some reason you don't have the servers CACert you can use the server's certificate itself as the CACert.

In order to obtain the server's certificate use the following command, (assuming you already have openssl installed)

 

openssl s_client -connect somehost.com:443

Note: you should change the somehost.com:443 to the servers name and port.

 

 

Then extract out the text between "-----BEGIN CERTIFICATE-----" to "-----END CERTIFICATE-----"(inclusive of those two lines too) and save them in a file (cert.pem),

 

Hope this help...

Simone

cdiscla.inwind.it's picture

Hello, thanks for your

Hello, thanks for your answer, i've tried but i still get null as response :-(