| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- $targa = isset($_GET["targa"]) ? $_GET["targa"] : '';
- $targa = "VA050AG";
- try{
- $wd = "dettaglioAutoveicoloBase";
- $wd = "datiCartaCircolazioneAutoveicoloProprietario";
- $url = 'https://www.ilportaledellautomobilista.it/Info-ws/services';
- $url = 'http://e-servizicoll.dtt.ilportaledellautomobilista.it/Info-ws-sh/services';
- $client = new \SoapClient($url . '/' . $wd . '/' . $wd . '.wsdl', array(
- 'stream_context' => stream_context_create(array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- )),
- 'trace' => 1
- ));
- $utente = 'CMRM001301';
- $password = '2PMPM*89';
- $utente = 'PRFR000191';
- $password = 'TEST.001';
- $xml = '<wsse:Security
- xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
- SOAP-ENV:mustUnderstand="1">
- <wsse:UsernameToken
- xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- wsu:Id="XWSSGID-1253605895203984534550">
- <wsse:Username>' . $utente . '</wsse:Username>
- <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $password . '</wsse:Password>
- </wsse:UsernameToken>
- </wsse:Security>';
- $header = new \SoapHeader(
- 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd',
- 'Security',
- new \SoapVar($xml, XSD_ANYXML),
- true
- );
- $client->__setSoapHeaders($header);
- $classe = "dettaglioAutoveicoloBase";
- $classe = "dettaglioCartaCircolazioneProprietarioAutoveicolo";
- try {
- $obj = $client->__soapCall($classe, array(
- $classe . "Request" => array(
- "login" => array(),
- "targa" => array("numeroTarga" => $targa),
- "pdf" => false
- )
- ));
- echo "<h3>RESPONSE OBJECT</h3>";
- print '<pre>';
- print_r($obj);
- print '</pre>';
- echo "<hr><h3>SOAP REQUEST HEADERS</h3>";
- echo "<pre>" . htmlspecialchars($client->__getLastRequestHeaders()) . "</pre>";
- echo "<h3>SOAP REQUEST</h3>";
- echo "<pre>" . htmlspecialchars($client->__getLastRequest()) . "</pre>";
- echo "<hr><h3>SOAP RESPONSE HEADERS</h3>";
- echo "<pre>" . htmlspecialchars($client->__getLastResponseHeaders()) . "</pre>";
- echo "<h3>SOAP RESPONSE</h3>";
- echo "<pre>" . htmlspecialchars($client->__getLastResponse()) . "</pre>";
- } catch (\SoapFault $fault) {
- $x = $fault->getMessage();
- echo "<h3>SOAP ERROR</h3>";
- echo $fault->getMessage();
- echo "<h3>Last SOAP Request</h3>";
- echo "<pre>" . htmlspecialchars($client->__getLastRequest()) . "</pre>";
- }
- /*
- try {
- $this->loadTarga = "OK";
- $obj = $client->__soapCall($classe, array(
- $classe . "Request" => array(
- "login" => array(),
- "targa" => array("numeroTarga" => $targa),
- "pdf" => false
- )
- ));
-
- print_r($obj);
-
- } catch (\SoapFault $fault) {
- $this->loadTarga = $fault->getMessage();
- }
- */
- } catch (\Exception $ex) {
- print($ex->getMessage());
- }
- ?>
|