I'm trying to send a SOAP - PHP request with a DER certificate (that means the certificate don't have a privateKey) but no success.
$local_cert = FULL_PATH_TO_MY_CERT;
$client = new SoapClient($wsdl, array(
'local_cert' => $local_cert,
'trace' => 1,
'exceptions' => 1,
'soap_version' => SOAP_1_1,
'encoding' => 'ISO-8859-1',
'compression' => (SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP),
'location' => 'https://webserviceurl:port/ws/servlet/ws'
));
Only I recieve this errors:
Warning (2): SoapClient::SoapClient() [soapclient.soapclient]: Unable to set private key file `PATHTOMYLOCALCERT' [APP\Vendor\WebServices\MyWS.php, line 206]
Warning (2): SoapClient::SoapClient() [soapclient.soapclient]: failed to create an SSL handle [APP\Vendor\WebServices\MyWS.php, line 206]
Warning (2): SoapClient::SoapClient() [soapclient.soapclient]: Failed to enable crypto [APP\Vendor\WebServices\MyWS.php, line 206]
Warning (2): SoapClient::SoapClient(https://webserviceurl:port/ws/servlet/ws?wsdl) [soapclient.soapclient]: failed to open stream: operation failed [APP\Vendor\WebServices\MyWS.php, line 206]
Warning (2): SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://webserviceurl:port/ws/servlet/ws?wsdl" [APP\Vendor\WebServices\MyWS.php, line 206]
but I've found a little trick (in php.net) using the function file_get_contents($local_cert); the errors are gone.
But a new error come from.
Result : string(773) "Error reading prefix:Action.Execute"
What I mean is... this error above... is comming from the WebService? because it cannot authenticate with my request?
Thanks everybody. (appreciate your answers)