Hi all
this is my first message :)
i have a big problem :). I must use Nusoap with OpenSSL. The problem is that i
have a "SSL certificate file".
i think that this is the right code:
<?php
$ticket = "";
$NotWsdl = "https://spaitest.prova.it:8443/ccx/NumberPortability";
$SchemasHeader = "http://dtdspai.prova.it/XMLSchemas/security2.0";
$headers =
"<security:sessionContext><ticket>$ticket</ticket></security:sessionContext>";
$username = "";
$password = "";
$authtype = ""; //(basic, digest, certificate)
$msisdn = "telephon number";
// keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase,
verifypeer (optional), verifyhost (optional)
// cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem'
// sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'
// sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem'
// passphrase: SSL key password/passphrase
// verifypeer: default is 1
// verifyhost: default is 1
$sslcertfile = ""; //SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'
$sslkeyfile = ""; //SSL key file, e.g. '$pathToPemFiles/mykey.pem'
$passphrase = ""; SSL key password/passphrase//
$certRequest = array('sslcertfile'=>$sslcertfile, 'sslkeyfile'=>$sslkeyfile,
'passphrase'=>$passphrase);
$soap = new soapclient($NotWsdl);
$soap = $soap->setHeaders($SchemasHeader, $headers);
$soap = $soap->setCredentials($username, $password, $authtype, $certRequest);
$resvalue = $soap->call('checkMSISDNOperator', $msisdn);
?>
this should be a xml request:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header><security:sessionContext
xmlns:security="http://dtdspai.prova.it/XMLSchemas/security2.0"><ticket>23214970129352287121110895749855</ticket></security:sessionContext>
</soapenv:Header>
<soapenv:Body>
<checkMSISDNOperator xmlns="capeconnect:NumberPortability:CRMClient">
<msisdn xmlns="">+39328XXXXXX</msisdn>
</checkMSISDNOperator>
</soapenv:Body>
</soapenv:Envelope>
this should be a xml response:
<?xml version="1.0" encoding="utf-8"?>
<env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:methodns="capeconnect:NumberPortability:CRMClient">
<env:Body>
<methodns:checkMSISDNOperatorResponse>
<return
xsi:type="xsd:string">operator</return>
</methodns:checkMSISDNOperatorResponse>
</env:Body>
</env:Envelope>
The php/nusoap code is correct? With OpenSSL i need CURL extension?
TNKS :)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
|