ソースを参照

Gestione motocicli

Luca Parisio 1 ヶ月 前
コミット
44babf95a9
4 ファイル変更118 行追加9 行削除
  1. 4 4
      app/Http/Livewire/Report.php
  2. 8 4
      public/targa.php
  3. 105 0
      public/targa_moto.php
  4. 1 1
      storage/scripts/vpn-config.conf

+ 4 - 4
app/Http/Livewire/Report.php

@@ -1401,8 +1401,8 @@ class Report extends Component
             try {
                 Log::info("veicolo con targa: " . $targa);
 
-                $wd = "dettaglioAutoveicoloBase";
-                $wd = "datiCartaCircolazioneAutoveicoloProprietario";
+                //$wd = "dettaglioAutoveicoloBase";
+                $wd = $this->vei_tipo_id == env('MOTOCICLO', 5) ? "datiCartaCircolazioneMotoveicoloProprietario" : "datiCartaCircolazioneAutoveicoloProprietario";
 
                 Log::info("wd: " . $wd);
 
@@ -1441,8 +1441,8 @@ class Report extends Component
                     true
                 );
                 $client->__setSoapHeaders($header);
-                $classe = "dettaglioAutoveicoloBase";
-                $classe = "dettaglioCartaCircolazioneProprietarioAutoveicolo";
+                
+                $classe = $this->vei_tipo_id == env('MOTOCICLO', 5) ? "dettaglioCartaCircolazioneProprietarioMotoveicolo" : "dettaglioCartaCircolazioneProprietarioAutoveicolo";
 
                 try {
                     $this->loadTarga = "OK";

+ 8 - 4
public/targa.php

@@ -1,13 +1,12 @@
 <?php
 $targa = isset($_GET["targa"]) ? $_GET["targa"] : '';
-$targa = "FM636CP";
+$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(
@@ -22,6 +21,9 @@ try{
     $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">
@@ -53,7 +55,9 @@ try{
         ));
 
         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>";
@@ -68,7 +72,7 @@ try{
         echo "<pre>" . htmlspecialchars($client->__getLastResponse()) . "</pre>";
 
     } catch (\SoapFault $fault) {
-        $this->loadTarga = $fault->getMessage();
+        $x = $fault->getMessage();
 
         echo "<h3>SOAP ERROR</h3>";
         echo $fault->getMessage();

+ 105 - 0
public/targa_moto.php

@@ -0,0 +1,105 @@
+<?php
+$targa = isset($_GET["targa"]) ? $_GET["targa"] : '';
+$targa = "VD02001";
+try{
+    
+    $wd = "datiCartaCircolazioneMotoveicoloProprietario";
+
+    $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 = "dettaglioCartaCircolazioneProprietarioMotoveicolo";
+
+    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());
+}
+?>
+

+ 1 - 1
storage/scripts/vpn-config.conf

@@ -1,3 +1,3 @@
 VPN_USERNAME="com.cmrmp013.0001"
-VPN_PASSWORD="SuperQuindici-50"
+VPN_PASSWORD="SuperQuindici-54"
 VPN_SERVER="anyvpn.ilportaledellautomobilista.it/utentiMCTC"