0

I need to consume a webService soap with a certificate.

I have a .pfx file and a password.

My code is the next one

require_once('lib/nusoap.php');

$endpoint = "https://interno.vuds-omc.es:9000/WSRegistroMedico";
$localCert = "cert.pfx"; 
$options = array(
    'local_cert' => $localCert, 
    'passphrase' => 'key0666001',
    'soap_version' => 'SOAP_1_2', 
    'encoding' => 'ISO-8859-1',
    'compression' => '(SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP)',
    'location' => ''); 
$client = new soapclient('http://binterno.vuds-omc.es:8000/WSRegistroMedicos?wsdl', $options);

$err = $client->getError(); 
if ($err) { // Display the error    
    echo "<h2>Error</h2>" . $err ; // At this point, you know the call that follows will fail
}

//$strxml is a string with the xml format 

$result = $client->call('ActualizacionColegiado',$strxml);

The request that i get is "UNAUTHORIZED USER" so, i think that it´s no taking de certificate

Thanks!!

l-x
  • 1,521
  • 9
  • 17
isaacsc
  • 1
  • 1
  • 2
  • I think this can help you. http://stackoverflow.com/questions/15413646/converting-pfx-to-pem-using-openssl – Javier Neyra Jan 13 '14 at 21:15
  • 1
    Why do you instantiate a SoapClient object instead a nusoap_client as you seem to want to do, since you load the nusoap library? – marcocassisa Oct 24 '15 at 15:24

0 Answers0