How to make a SOAP call with certificates
Posted: Tue Mar 11, 2008 12:35 pm
Hi.
I'd like to "translate" this cURL call (which works ok) to PHP SOAP:
Contents of "file.xml":
I don't know how to implement it with:
Any suggestion?
I'd like to "translate" this cURL call (which works ok) to PHP SOAP:
Code: Select all
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
Code: Select all
<?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>
Code: Select all
$wsdl = 'https://lab.webservice.com/UsersService.asmx';
$client = new SOAPClient($wsdl);
$params = array(
'userId' => '555',
'lastName' => 'Smith'
);
$response = $client->__call(....