Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
message_out.xml
tags
.*.sw[op]
/message_in.xml
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changelog

Tutte le modifiche significative a questo progetto verranno documentate in questo file.

Il formato è basato su [Tenere un changelog](https://keepachangelog.com/en/1.0.0/),
e il progetto si conforma al [Versionamento semantico](https://semver.org/spec/v2.0.0.html).

## [Non rilasciato]

### Aggiunto

- supporto operazione P001
- CHANGELOG.md (questo file)
- trust con certificato wstest.anpr.interno.it aggiornato

### Modificato

- aggiornate versioni dipendenze
- aggiornate versioni plugin maven
- l'ambiente di riferimento è ora test comuni

### Rimosso

- supporto ambiente free test [italia/anpr #3403](https://github.com/italia/anpr/issues/3403).

## [1.3.0] - XXXX-XX-XX

### Aggiunto

- fork da <https://github.com/italia/anpr-client-example>
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Partecipa sul canale #anpr](https://img.shields.io/badge/Slack%20channel-%23anpr-blue.svg)](https://developersitalia.slack.com/messages/C7A8NS7RQ)
[![Ricevi un invito a Slack](https://slack.developers.italia.it/badge.svg)](https://slack.developers.italia.it/)
[![Keep a Changelog v1.1.0 badge](https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.1.0-%23E05735)](CHANGELOG.md)

# Client Java di esempio per il test di connessione ad ANPR

Expand All @@ -8,12 +9,12 @@
## Impostare le credenziali

Per rendere il client utilizzabile, è importante impostare, al primo utilizzo, i certificati con le credenziali di test.
Per ottenere delle credenziali di test, si prega di compilare il modulo all'indirizzo https://anpr-test.bobuild.com/request.
Per ottenere delle credenziali di test, è necessario richiederle al comune per conto del quale è in corso l'integrazione software.

Per personalizzare il certificato bisogna:

- Creare il file `src/main/resources/config/FREE_Keystore.properties` partendo dall'esempio `src/main/resources/config/Example_FREE_Keystore.properties` inserendo i riferimenti al proprio ceritficato, al codice della postazione e al PIN del certificato.
- Aggiungere il certificato ottenuto nella cartella `keystore/FREE`
- Creare il file `src/main/resources/config/TEST_Keystore.properties` partendo dall'esempio `src/main/resources/config/Example_TEST_Keystore.properties` inserendo i riferimenti al proprio ceritficato, al codice della postazione e al PIN del certificato.
- Aggiungere il certificato ottenuto nella cartella `keystore/TEST`

## Installazione

Expand Down Expand Up @@ -46,7 +47,7 @@ docker run -it --rm --name anpr-client-running-app anpr-client-app

Una volta ricevute le credenziali, si potrà accedere all'applicazione web di test per visualizzare e svolgere operazioni con i dati caricati.

Per fare ciò è necessario importare il certificato ricevuto (sbloccandolo con il rispettivo PIN) nel proprio sistema operativo o nel proprio browser. Dopodiché sarà possibile accedere a https://dpfree.anpr.interno.it/combas con nome utente e password ricevute via mail.
Per fare ciò è necessario importare il certificato ricevuto (sbloccandolo con il rispettivo PIN) nel proprio sistema operativo o nel proprio browser. Dopodiché sarà possibile accedere a https://dptest.anpr.interno.it/combas con nome utente e password ricevute via mail.

# Link utili
* [Pagina di ANPR su Developers Italia](https://developers.italia.it/it/anpr)
Expand Down
File renamed without changes.
File renamed without changes.
Binary file modified keystore/cacerts
Binary file not shown.
29 changes: 29 additions & 0 deletions keystore/wstest.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIFCjCCAvKgAwIBAgIUHot+7N+TttaexPY/oroHWLk0LLAwDQYJKoZIhvcNAQEL
BQAwXzEgMB4GA1UEAwwXQ0EgQU5QUiBQb3N0YXppb25pIFN2aWwxDTALBgNVBAsM
BEFOUFIxHzAdBgNVBAoMFk1pbmlzdGVybyBkZWxsJ0ludGVybm8xCzAJBgNVBAYT
AklUMB4XDTI1MTAyMDE0MjU0NVoXDTI3MTAyMDE0MjU0N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0NYGNgczydooORDW/qa7lcMimUr6m/4i/CGmVG7HbfARj+cN
13KObI+qx7sK4LXTmBit0t7kWn31iY7IPggtio8SjCNSsi9m/eXk6AU1cO/Ft7Ai
eg3niXBh4UuZU4X2QthfHpxXVF1XBG2xwwpJ66hdEY+vMmI+KUJMJAmcbwrJiSbB
ea9QSN+wW0cpkLj8M3WUyICn+VN7Tw+eyDY7KQ/N1IS+tir14krmolmUz3lycV8K
fl017oYbiR5zDDg1JNHLC8zFiYeUPiT2qv15xlocGFobTk7fUtfHsLfOtakyZ7wr
MYOQ/NkkTHyAJF+okHKguFmfFuL/J9YH66lfzyuaPiGPTwHK/zjOCXV+n5PUXnfu
GsUpGL/UGzr0kPuvdZHISOe+9xRQvzr0BKmwqwE2UQfIVgFWn+CY20+6+7cqgw==
-----END CERTIFICATE-----
142 changes: 31 additions & 111 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
</license>
</licenses>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.1.7.RELEASE</spring.version>
<spring.version>5.3.39</spring.version>
<apache.cxf.version>3.1.8</apache.cxf.version>
<opensaml.version>3.1.1</opensaml.version>
<bouncycastle.version>1.56</bouncycastle.version>
<bouncycastle.version>1.70</bouncycastle.version>
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<junit.version>4.13.2</junit.version>
<fj-core.version>8.6.9</fj-core.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -84,14 +89,13 @@
<artifactId>cxf-rt-transports-http</artifactId>
<version>${apache.cxf.version}</version>
</dependency>
<!-- Jetty is needed if you're are not using the CXFServlet -->

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${apache.cxf.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-transports-http -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
Expand All @@ -109,29 +113,29 @@
<version>${bouncycastle.version}</version>
</dependency>


<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<version>2.0.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.25.0</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-core</artifactId>
<version>0.1.4</version>
<version>${fj-core.version}</version>
</dependency>

</dependencies>
Expand All @@ -141,12 +145,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<meminitial>256m</meminitial>
<maxmem>512m</maxmem>
Expand All @@ -155,6 +159,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
Expand Down Expand Up @@ -185,8 +190,6 @@
<artifactId>jaxb-xjc</artifactId>
<version>2.2</version>
</dependency>


</dependencies>

<executions>
Expand Down Expand Up @@ -285,6 +288,15 @@
<bindingFile>${basedir}/src/main/resources/binding_A000.xml</bindingFile>
</bindingFiles>
</wsdlOption>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/P000ServiziCittadino.wsdl</wsdl>
<serviceName>AnprServiceP000</serviceName>
<wsdlLocation>classpath:wsdl/P000ServiziCittadino.wsdl</wsdlLocation>
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/binding_P000_xsd.xml</bindingFile>
<bindingFile>${basedir}/src/main/resources/binding_P000.xml</bindingFile>
</bindingFiles>
</wsdlOption>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/S001subentro.wsdl</wsdl>
<serviceName>AnprServiceS001</serviceName>
Expand All @@ -308,101 +320,9 @@
</execution>
</executions>
</plugin>
<!-- <plugin> -->
<!-- <groupId>com.webcohesion.enunciate</groupId> -->
<!-- <artifactId>enunciate-maven-plugin</artifactId> -->
<!-- <version>2.8.0</version> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <id>docs</id> -->
<!-- <phase>prepare-package</phase> -->
<!-- <goals> -->
<!-- <goal>docs</goal> -->
<!-- </goals> -->
<!-- <configuration> -->
<!-- <configFile>enunciate.xml</configFile> -->
<!-- </configuration> -->
<!-- </execution> -->
<!-- <execution> -->
<!-- <id>install</id> -->
<!-- <goals> -->
<!-- <goal>install-artifact</goal> -->
<!-- <goal>deploy-artifact</goal> -->
<!-- </goals> -->
<!-- <configuration> -->
<!-- <enunciateArtifactId> -->
<!-- java.xml.client.library</enunciateArtifactId> -->
<!-- <groupId>it.sogei.anpr</groupId> -->
<!-- <artifactId>myServiceClient</artifactId> -->
<!-- <version>1.0</version> -->
<!-- </configuration> -->
<!-- </execution> -->

<!-- </executions> -->
<!-- <dependencies> -->
<!-- </dependencies> -->
<!-- </plugin> -->


<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>it.interno.anpr.testconn.gui.GUIFrame</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
-->
</plugins>
<!-- <resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>config/*</exclude>
</excludes>
</resource>
</resources>
--> </build>

<!--
<profiles>
Permette di creare un package distribuibile con tutti i jar di dipendenza.
<profile>
<id>singlepackage</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<finalName>dist-${artifactId}-${version}</finalName>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
-->
</build>

</project>
41 changes: 21 additions & 20 deletions request/3002/3002_888002_FREE.req → request/3002/3002_A1_TEST.req
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<ns2:Richiesta3002 xmlns:ns2="http://sogei.it/ANPR/3000consultazione">
<testataRichiesta>
<idOperazioneComune>999997</idOperazioneComune>
<codMittente>888002</codMittente>
<codDestinatario>ANPR00</codDestinatario>
<operazioneRichiesta>3002</operazioneRichiesta>
<dataOraRichiesta>2017-03-27T19:20:11.543+02:00</dataOraRichiesta>
<tipoOperazione>C</tipoOperazione>
<tipoInvio>FREE</tipoInvio>
</testataRichiesta>
<criteriRicerca>
<cognome>ROSSI</cognome>
<nome>MARIO</nome>
</criteriRicerca>
<datiRichiesta>
<schedaAnagraficaRichiesta>1</schedaAnagraficaRichiesta>
<dataRiferimentoRichiesta>2017-03-27+02:00</dataRiferimentoRichiesta>
<datiAnagraficiRichiesti>2</datiAnagraficiRichiesti>
</datiRichiesta>
</ns2:Richiesta3002>
<ns2:Richiesta3002 xmlns:ns2="http://sogei.it/ANPR/3000consultazione">
<testataRichiesta>
<idOperazioneComune>999997</idOperazioneComune>
<codMittente>036030</codMittente>
<codDestinatario>ANPR06</codDestinatario>
<operazioneRichiesta>3002</operazioneRichiesta>
<dataOraRichiesta>2025-07-02T19:20:11.543+02:00</dataOraRichiesta>
<tipoOperazione>C</tipoOperazione>
<tipoInvio>TEST</tipoInvio>
</testataRichiesta>
<criteriRicerca>
<cognome>TURING</cognome>
<nome>ALAN</nome>
</criteriRicerca>
<datiRichiesta>
<schedaAnagraficaRichiesta>1</schedaAnagraficaRichiesta>
<dataRiferimentoRichiesta>2025-07-03+02:00</dataRiferimentoRichiesta>
<datiAnagraficiRichiesti>1</datiAnagraficiRichiesti>
<ricercaNazionale>1</ricercaNazionale>
</datiRichiesta>
</ns2:Richiesta3002>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<tipoOperazione>C</tipoOperazione>

<tipoInvio>FREE</tipoInvio>
<tipoInvio>TEST</tipoInvio>

<dataDefinizionePratica>2018-05-29</dataDefinizionePratica>

Expand Down
18 changes: 18 additions & 0 deletions request/P001/P001_XXXXXX_TEST.req
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<ns2:RichiestaP001 xmlns:ns2="http://sogei.it/ANPR/P000sc">
<testataRichiesta>
<idOperazioneComune>0</idOperazioneComune>
<codMittente>999999</codMittente>
<codDestinatario>ANPR05</codDestinatario>
<operazioneRichiesta>P001</operazioneRichiesta>
<dataOraRichiesta>2022-07-14T16:43:51.061+02:00</dataOraRichiesta>
<tipoOperazione>C</tipoOperazione>
<tipoInvio>TEST</tipoInvio>
<dataDecorrenza>2022-07-14+02:00</dataDecorrenza>
</testataRichiesta>
<criteriRicerca>
<dataIniziale>2024-09-01</dataIniziale>
<dataFinale>2024-09-11</dataFinale>
<idTipologia>2</idTipologia>
<idStatoRichiesta/>
</criteriRicerca>
</ns2:RichiestaP001>
Loading