guarriman Posted March 11, 2008 Share Posted March 11, 2008 Hi. I'd like to "translate" this cURL call (which works ok) to PHP SOAP: curl \ --data @file.xml \ --header "Content-Type: text/xml; charset=utf-8" \ --header "SOAPAction: http://lab.webservice.com/IsValidUser" \ -v \ -G \ --key key.pem \ --cert verisign.crt \ https://lab.webservice.com/UsersService.asmx Contents of "file.xml": <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <IsValidUser xmlns="http://lab.webservice.com/"> <userId>555</userId> <lastName>Smith</lastName> </IsValidUser> </soap:Body> </soap:Envelope> I don't know how to implement it with: $wsdl = 'https://lab.webservice.com/UsersService.asmx'; $client = new SOAPClient($wsdl); $params = array( 'userId' => '555', 'lastName' => 'Smith' ); $response = $client->__call(.... Any suggestion? Quote Link to comment https://forums.phpfreaks.com/topic/95652-how-to-make-a-soap-call-with-certificates/ Share on other sites More sharing options...
guarriman Posted March 11, 2008 Author Share Posted March 11, 2008 I tried with: $wsdl = 'https://lab.domain.com/UserService.asmx'; $local_cert = 'key-cert.pem'; $passphrase = 'foofoo'; $client = new SoapClient($wsdl, array('trace'=>true, 'exceptions'=>true, 'local_cert' => $local_cert, 'passphrase' => $passphrase)); but I get this error message: PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://lab.domain.com/UserService.asmx' in /home/code/soap4.php on line 7 Quote Link to comment https://forums.phpfreaks.com/topic/95652-how-to-make-a-soap-call-with-certificates/#findComment-489747 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.