WSDL
Di seguito le istruzioni per contattare i web service eportale.
1. Indicazioni
NOTA: L'ambiente di produzione è presente all'indirizzo: https://eportale.eu/service-ejb/FatturaElettronicaService?wsdl
NOTA: Azienda di test in produzione
| Campo | Valore |
|---|---|
| Codice Azienda | Gamma |
| Utente | gamma |
| Password | gamma |
1.4. La seguente sezione XML verra sovrascritta con i dati relativi alla trasmissione
<IdTrasmittente>
<IdPaese>IT</IdPaese>
<IdCodice>00000000000</IdCodice>
</IdTrasmittente>
2. Descrizione servizi esposti
2.1. WS1 importare, firmare ed inviare fatture elettroniche secondo lo standard SDI 1.2.
DocImportPaService
importFeAttivo, importFatturaPaSigned:
consente di importare, firmare ed inviare fatture elettroniche secondo lo standard SDI 1.2.
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si sta importando il documento, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
fileName: nome xml della fattura che si sta caricando ("IT11111111111_00001.xml - .p7m");
xmlDoc: array di byte del file;
signAndSand: valore boolean se impostato a 'TRUE' la fattura che si sta caricando viene automaticamente firmata ed inviata (se l'azienda ha la firma automatica)
Valore di ritorno:
eportaleInfo:
esito: se = 0 il processo è andato a buon fine; != 0 ci sono stati errori, da verificare nel campo descrizione
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:importFeAttivo>
<arg0>
<fileName>IT0000000000_XXXXX.xml</fileName>
<signAndSand>1</signAndSand>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<xmlDoc>[array]</xmlDoc>
</arg0>
</ws:importFeAttivo>
</soapenv:Body>
</soapenv:Envelope>
ESEMPIO JAVA:
public void testImportFeAttivo(){
try{
Utente uut = new Utente();
uut.setCodiceAzienda(CODICE_AZIENDA_1);
uut.setUsername(USER);
uut.setPassword(PASSWD);
FileInputStream in = new FileInputStream(new File(PATH + "IT03455460547_00096.xml"));
byte[] bb = new byte[in.available()];
in.read(bb);
in.close();
DocImportPaItem ddc = new DocImportPaItem();
ddc.setUtente(uut);
ddc.setFileName("IT03455460547_00096.xml");
ddc.setXmlDoc(bb);
ddc.setSignAndSand(true);
//sandbox.fatturaelettronica.FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaService port1 = service1.getFatturaElettronicaServicePort();
sandbox.fatturaelettronica.eportaleInfo mmi = port1.importFeAttivo(ddc);
System.out.println("-testImportFeAttivo: " + mmi.getEsito() + " - " + mmi.getDescrizione());
}catch(Exception ex){
ex.printStackTrace();
}
}
2.2. WS2 consente di scaricare le fatture passive ricevute nel sistema tramite codice univoco o pec dedicata
ATTENZIONE: Importante: in ambiente di test non è possibile ricevere fatture passive dato che non è collegato al circuito SDI per tutti i test utilizzare l'azienda Gamma come riportato nella request sottostante
ATTENZIONE: Impostato un limite massimo di 20 fatture prelevabili con una singola request. Se si hanno un numero superiore di fatture a disposizione andranno fatte più request
getFeRicevute:
consente di scaricare le fatture passive ricevute nel sistema:
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si stanno scaricando i documenti, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
dateLong: in millisecondi verrano restituiti solo i documenti RICEVUTI nell'arco della 24h dalla data indicata
fileName: valorizzando questo parametro verra scaricata la fattura con quel nome ignorando il fatto che siano state gia scaricate
Valore di ritorno:
Lista di oggetti: <DocFe>: lista dei documenti restituiti:
DocFe.code: codice del documento, (numero)
DocFe.date: data del documento
DocFe.docData: array di byte
DocFe.docName: nome del file xml o p7m
DocFe.lastUpdate: data ricezione documento.
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeRicevute>
<arg0>
<dateLong>millisecondi</dateLong>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
</arg0>
</ws:getFeRicevute>
</soapenv:Body>
</soapenv:Envelope>
ESEMPIO JAVA:
public void testGetFeRicevute(){
try{
Utente uut = new Utente();
uut.setCodiceAzienda(CODICE_AZIENDA_1);
uut.setUsername(USER);
uut.setPassword(PASSWD);
DocImportPaItem ddc = new DocImportPaItem();
ddc.setUtente(uut);
FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaService port1 = service1.getFatturaElettronicaServicePort();
List<DocFe> ll = port1.getFeRicevute(ddc);
if(ll != null && ll.size() > 0){
System.out.println("*******************************************************************************************");
for(DocFe ddf : ll){
System.out.println(ddf.getCode() + "; " + ddf.getDate() + "; " + ddf.getDocName() + "; " + ddf.getLastUpdate());
System.out.println(ddf.getDocData());
FileOutputStream out = new FileOutputStream(new File(PATH + ddf.getDocName()));
out.write(ddf.getDocData());
out.flush();
out.close();
}
System.out.println("*******************************************************************************************");
}
}catch(Exception ex){
ex.printStackTrace();
}
}
2.3. WS3 consente di recuperare le notifiche relative una fattura firmata ed inviata dal sistema
Attenzione: Importante: in ambiente di test non è possibile ricevere notifiche di invio dato che non è collegato al circuito SDI per tutti i test utilizzare l'azienda Gamma come riportato nella request sottostante.
getNotificheList:
consente di recuperare le notifiche generate da una fattura firmata ed inviata dal sistema
Parametro in ingresso:
NotificaParam:
AziendaCod: codice azienda della si sta caricado la fattura;
UtenteCod: utente
FileName: nome file della fattura firmata ed inviata precedentemente senza estensione AGGIORNAMENTO dal 02/10/2019 è possible inviare nel paramento un elenco di file separato da "|" pipe (Ascii 166)
DocData: verranno restituite tutte le notifiche per i documenti emessi in questa data
REQUEST SOAP:
<!-- REQUEST FILE SINGOLO -->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getNotificheList>
<arg0>
<aziendaCod>Gamma</aziendaCod>
<utenteCod>gamma</utenteCod>
<fileName>IT0000000000_XXXXX</fileName>
<docData>2019-04-15</docData>
</arg0>2
</ws:getNotificheList>
</soapenv:Body>
</soapenv:Envelope>
<!-- REQUEST FILE MULTIPLI -->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getNotificheList>
<arg0>
<aziendaCod>Gamma</aziendaCod>
<utenteCod>gamma</utenteCod>
<fileName>IT0000000000_XXXXX|IT0000000000_XXXX1|IT0000000000_XXXX2|IT0000000000_XXXX3|IT0000000000_XXXX4</fileName>
<docData>2019-04-15</docData>
</arg0>
</ws:getNotificheList>
</soapenv:Body>
</soapenv:Envelope>
ESEMPIO JAVA:
public void testGetNotificheList(){
try{
NotificaParam notificaParam = new NotificaParam();
notificaParam.setAziendaCod(CODICE_AZIENDA_1);
notificaParam.setUtenteCod(USER);
notificaParam.setFileName("nome fattura xml / p7m (elenco nomi file separati da pipe)");
FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaService port1 = service1.getFatturaElettronicaServicePort();
List<NotificaRequest> ll = port1.getNotificheList(notificaParam);
}catch(Exception ex){
ex.printStackTrace();
}
}
2.4. WS4 Restituisce i dati dell'azienda, fra cui i CREDITI RESIDUI
getAzienda:
restituisce i dati dell'azienda un esempio per verificare i crediti residui
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si invia il documento, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
Valore di ritorno:
Azienda
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getAzienda>
<arg0>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
</arg0>
</ws:getAzienda>
</soapenv:Body>
</soapenv:Envelope>
ESEMPIO JAVA:
public void testGetAzienda(){
try{
Utente uut = new Utente();
uut.setCodiceAzienda(CODICE_AZIENDA_1);
uut.setUsername(USER);
uut.setPassword(PASSWD);
DocImportPaItem ddc = new DocImportPaItem();
ddc.setUtente(uut);
FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaService port1 = service1.getFatturaElettronicaServicePort();
ddc = new DocImportPaItem();
ddc.setUtente(uut);
Azienda aaz = port1.getAzienda(ddc);
System.out.println("- testGetAzienda: " + aaz.getCrediti());
}catch(Exception ex){
ex.printStackTrace();
}
}
2.5. WS5 consente di importare una fattura PASSIVA secondo lo standard SDI 1.2
importFePassivo:
consente di importare (per conservare) una fattura secondo lo standard SDI 1.2 chè è stata ricevuta dal sistema di intersambio
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si sta importando il documento, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
fileName: nome xml della fattura che si sta caricando ("IT11111111111_00001.xml - .p7m");
xmlDoc: array di byte della fattura;
Valore di ritorno:
eportaleInfo:
esito: se = 0 il processo è andato a buon fine; != 0 ci sono stati errori, da verificare nel campo descrizione
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:importFeAttivo>
<arg0>
<fileName>IT0000000000_XXXXX.xml</fileName>
<signAndSand>1</signAndSand>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<xmlDoc>[array]</xmlDoc>
</arg0>
</ws:importFeAttivo>
</soapenv:Body>
</soapenv:Envelope>
ESEMPIO JAVA:
public void testImportFePassivo(){
try{
FileInputStream in = new FileInputStream(new File(PATH + "IT03141290548_00019.xml.p7m"));
byte[] cc = new byte[in.available()];
in.read(cc);
in.close();
Utente uut = new Utente();
uut.setCodiceAzienda(CODICE_AZIENDA_2);
uut.setUsername(USER);
uut.setPassword(PASSWD);
DocImportPaItem ddc = new DocImportPaItem();
ddc.setUtente(uut);
ddc.setFileName("IT03141290548_00019.xml.p7m");
ddc.setXmlDoc(cc);
FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaService port1 = service1.getFatturaElettronicaServicePort();
eportaleInfo mmi = port1.importFePassivo(ddc);
System.out.println("-importFePassivo: " + mmi.getEsito() + " - " + mmi.getDescrizione());
}catch(Exception ex){
ex.printStackTrace();
}
}
2.6. WS6 consente di importare per conservare una fattura secondo lo standard SDI 1.2
conservaFe:
consente di importare e conservre una fattura secondo lo standard SDI 1.2 che è già stata firmata ed inviata
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si sta importando il documento, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
fileName: nome xml della fattura che si sta caricando ("IT11111111111_00001.xml - .p7m");
xmlDoc: array di byte della fattura;
Valore di ritorno:
eportaleInfo:
esito: se = 0 il processo è andato a buon fine; != 0 ci sono stati errori, da verificare nel campo descrizione
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:conservaFe>
<arg0>
<fileName>IT0000000000_XXXXX.xml</fileName>
<signAndSand>1</signAndSand>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<xmlDoc>[array]</xmlDoc>
</arg0>
</ws:conservaFe>
</soapenv:Body>
</soapenv:Envelope>
ESEMPIO JAVA:
public void testConservaFe(){
try{
FileInputStream in = new FileInputStream(new File(PATH + "IT03141290548_00019.xml.p7m"));
byte[] cc = new byte[in.available()];
in.read(cc);
in.close();
Utente uut = new Utente();
uut.setCodiceAzienda(CODICE_AZIENDA_2);
uut.setUsername(USER);
uut.setPassword(PASSWD);
DocImportPaItem ddc = new DocImportPaItem();
ddc.setUtente(uut);
ddc.setFileName("IT03141290548_00019.xml.p7m");
ddc.setXmlDoc(cc);
FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaService port1 = service1.getFatturaElettronicaServicePort();
eportaleInfo mmi = port1.conservaFe(ddc);
System.out.println("- testConservaFe: " + mmi.getEsito() + " - " + mmi.getDescrizione());
}catch(Exception ex){
ex.printStackTrace();
}
}
2.7. WS7 consente di scaricare le fatture attivie che sono state firmate e inviate dal sistema:
ATTENZIONE: Impostato un limite massimo di 20 fatture prelevabili con una singola request. Se si hanno un numero superiore di fatture a disposizione andranno fatte più request
getFeInviate:
consente di scaricare le fatture attivie che sono state firmate e inviate dal sistema:
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si stanno scaricando i documenti, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
dateLong: in millisecondi verrano restituiti solo i documenti INVIATI nell'arco della 24h dalla data indicata
Valore di ritorno:
Lista di oggetti: <DocFe>: lista dei documenti restituiti:
DocFe.code: codice del documento, (numero)
DocFe.date: data del documento
DocFe.docData: array di byte
DocFe.docName: nome del file xml o p7m
DocFe.lastUpdate: data ricezione documento.
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeInviate>
<arg0>
<dateLong>millisecondi</dateLong>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
</arg0>
</ws:getFeInviate>
</soapenv:Body>
</soapenv:Envelope>
ESEMPIO JAVA:
public void testGetFeRicevute(){
try{
Utente uut = new Utente();
uut.setCodiceAzienda(CODICE_AZIENDA_1);
uut.setUsername(USER);
uut.setPassword(PASSWD);
DocImportPaItem ddc = new DocImportPaItem();
ddc.setUtente(uut);
FatturaElettronicaServiceService service1 = new FatturaElettronicaServiceService();
FatturaElettronicaService port1 = service1.getFatturaElettronicaServicePort();
List<DocFe> ll = port1.getFeInviate(ddc);
if(ll != null && ll.size() > 0){
System.out.println("*******************************************************************************************");
for(DocFe ddf : ll){
System.out.println(ddf.getCode() + "; " + ddf.getDate() + "; " + ddf.getDocName() + "; " + ddf.getLastUpdate());
System.out.println(ddf.getDocData());
FileOutputStream out = new FileOutputStream(new File(PATH + ddf.getDocName()));
out.write(ddf.getDocData());
out.flush();
out.close();
}
System.out.println("*******************************************************************************************");
}
}catch(Exception ex){
ex.printStackTrace();
}
}
2.8. WS8 consente di rimuovere la firma elettronica dai file xml firmati:
getXmlFromP7m:
consente di rimuovere la firma elettronica dai file xml firmati:
Parametro in ingresso:
DocImportPaItem:
xmlDoc: array di byte della fattura;
Valore di ritorno:
xmlDoc: array di byte della fattura senza firma;
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocNomeFile>
<arg0>
<xmlDoc>[array]</xmlDoc>
</arg0>
</ws:getDocNomeFile>
</soapenv:Body>
</soapenv:Envelope>
2.9. WS9 consente di ottenere una lista di nome file
getDocNomeFile:
consente di ottenere una lista di nome file:
Parametro in ingresso:
DocFeFilter:
utente: Utente;
dataDal: Data DAL;
dataAl: Data AL;
versoEntrataUscita: VERSO_USCITA = 1 VERSO_ENTRATA = 0;
Valore di ritorno:
Lista di stringhe contentente i nomi file
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getDocNomeFile>
<arg0>
<dataDal>2019-01-01</dataDal>
<dataAl>2019-01-10</dataAl>
<utente>
<codiceAzienda>Gamma</codiceAzienda>
<username>gamma</username>
<password>gamma</password>
</utente>
<versoEntrataUscita>0</versoEntrataUscita>
</arg0>
</ws:getDocNomeFile>
</soapenv:Body>
</soapenv:Envelope>
2.10. WS10 consente di ottenere l'ultima notifica in ordine di tempo di uno specifico file
getNotifica:
consente di ottenere l'ultima notifica in ordine di tempo di uno specifico file :
Parametro in ingresso:
NotificaParam:
aziendaCod: Codice Azienda;
utenteCod: Nome Utente
fileName: Nome File
Valore di ritorno:
Notifica
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getNotifica>
<arg0>
<aziendaCod>Gamma</aziendaCod>
<fileName>IT0123456789_XXXXX.xml</fileName>
<utenteCod>gamma</utenteCod>
</arg0>
</ws:getNotifica>
</soapenv:Body>
</soapenv:Envelope>
2.11. WS11 consente di effettuare un richiesta di download delle fatture ricevute nel cassetto fiscale rimaste instato di mancata consegna
richiestaMancataConsegna:
consente di rimuovere la firma elettronica dai file xml firmati:
Parametri in ingresso:
SdiDownloadFe:
usr: Utente Cassetto fiscale;
pws: password cassetto fiscale;
pin: pin cassetto fiscale;
iva: partita iva dell’azienda per cui si fa la richiesta
dataInizioRicerca: data da quanto effettuare la ricerca;
Utente: Utente azienda;
Valore di ritorno:
nessuno, verranno importate le fatture passive in mancata consegna direttamente in fattura chiara
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:richiestaMancataConsegna>
<arg0>
<pin>?</pin>
<pwd>?</pwd>
<usr>?</usr>
<iva>?</iva>
<dataInizioRicerca>?</dataInizioRicerca>
</arg0>
<arg1>
<utente>
<codiceAzienda>Gamma</codiceAzienda>
<username>gamma</username>
<password>gamma</password>
</utente>
</arg1>
</ws:richiestaMancataConsegna>
</soapenv:Body>
</soapenv:Envelope>
2.12. WS12 consente di effettuare un richiesta per avere un elenco di fatture scartate e non reinviate ai clienti
getFattureScartateNonReinviate:
consente di effettuare un richiesta per avere un elenco di fatture scartate e non reinviate ai clienti
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si stanno scaricando i documenti, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
date: verranno restituiti solamente i documenti con data succesiva a quella impostata fino a 30 giorni in avanti
Valore di ritorno:
elenco dei documenti scartati e non reinviati a SDI
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFattureScartateNonReinviate>
<arg0>
<date>2018-10-10</date>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
</arg0>
</ws:getFattureScartateNonReinviate>
</soapenv:Body>
</soapenv:Envelope>
2.13. WS13 consente di ottenere la lista dell'ultima notifica in ordine di tempo di ogni file passato nel parametro fileName
getUltimaNotificaList:
consente di ottenere la lista dell'ultima notifica in ordine di tempo di ogni file passato nel parametro fileName
Parametro in ingresso:
NotificaParam:
aziendaCod: Codice Azienda;
utenteCod: Nome Utente
fileName: nome file della fattura firmata ed inviata precedentemente senza estensione, è possible inviare nel paramento un elenco di file separato da "|" pipe (Ascii 166) per ottenere con una sola request l'elenco di piu files
Valore di ritorno:
ultima notifica disponibile per i documenti
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getUltimaNotificaList>
<arg0>
<aziendaCod>Gamma</aziendaCod>
<utenteCod>gamma</utenteCod>
<fileName>IT0000000000_XXXXX|IT0000000000_XXXX1|IT0000000000_XXXX2|IT0000000000_XXXX3|IT0000000000_XXXX4</fileName>
</arg0>
</ws:getUltimaNotificaList>
</soapenv:Body>
</soapenv:Envelope>
2.14. WS14 consente di ottenere una lista di tutte le fatture effettivamente recapitate al cassetto fiscale del cliente
ATTENZIONE: Impostato un limite massimo di 20 fatture prelevabili con una singola request. Se si hanno un numero superiore di fatture a disposizione andranno fatte più request
getFeConsegnate:
consente di ottenere una lista di tutte le fatture effettivamente recapitate al cassetto fiscale del cliente
Parametro in ingresso:
DocFeFilter:
utente: Utente;
dataDal: Data DAL;
dataAl: Data AL;
Valore di ritorno:
elenco di documenti
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeConsegnate>
<arg0>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<dataDal>2019-01-01</dataDal>
<dataAl>2019-01-31</dataAl>
</arg0>
</ws:getFeConsegnate>
</soapenv:Body>
</soapenv:Envelope>
Metodi 2020: Sono stati creati nuovi metodi per che contengono il link per il dowload del file al posto del byte array cosi da ottimizzare le dimensioni delle response.
2.15. WS15 consente di ottenere una lista di tutte le fatture inviate con all'interno un link per effettuare il download del file se necessario
getFeInviateLink:
Parametro in ingresso:
DocFeFilter:
utente: Utente;
dataDal: Data DAL;
dataAl: Data AL;
Valore di ritorno:
elenco di documenti
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeInviateLink>
<arg0>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<dataDal>2019-01-01</dataDal>
<dataAl>2019-01-31</dataAl>
</arg0>
</ws:getFeInviateLink>
</soapenv:Body>
</soapenv:Envelope>
2.16. WS16 consente di ottenere una lista di tutte le fatture ricevute con all'interno un link per effettuare il download del file se necessario
getFeRicevuteLink:
Parametro in ingresso:
DocFeFilter:
utente: Utente;
dataDal: Data DAL;
dataAl: Data AL;
Valore di ritorno:
elenco di documenti
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeRicevuteLink>
<arg0>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<dataDal>2019-01-01</dataDal>
<dataAl>2019-01-31</dataAl>
</arg0>
</ws:getFeRicevuteLink>
</soapenv:Body>
</soapenv:Envelope>
2.17. WS17 consente di ottenere una lista di tutte le fatture inviate con stato confermato o messo a disposizione con all'interno un link per effettuare il download del file se necessario
getFeConsegnateLink:
Parametro in ingresso:
DocFeFilter:
utente: Utente;
dataDal: Data DAL;
dataAl: Data AL;
Valore di ritorno:
elenco di documenti
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeConsegnateLink>
<arg0>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<dataDal>2019-01-01</dataDal>
<dataAl>2019-01-31</dataAl>
</arg0>
</ws:getFeConsegnateLink>
</soapenv:Body>
</soapenv:Envelope>
2.18. WS18 consente di ottenere una lista di tutte le fatture di dui il download è gia stato effettuato con all'interno un link per effettuare il download del file se necessario
getFeScaricateLink:
Parametro in ingresso:
DocFeFilter:
utente: Utente;
dataDal: Data DAL;
dataAl: Data AL;
Valore di ritorno:
elenco di documenti
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeScaricateLink>
<arg0>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
<dataDal>2019-01-01</dataDal>
<dataAl>2019-01-31</dataAl>
</arg0>
</ws:getFeScaricateLink>
</soapenv:Body>
</soapenv:Envelope>
2.19. WS19 consente di ottenere la stampa pdf dato un xml
getPdfFromXml:
documentType: null = normale, 1 = semplificata, 100 = lotto, 101 = ordine
Parametro in ingresso:
DocImportPaItem:
documentType: tipo documento da convertire;
xmlDoc: array di byte del documento;
Valore di ritorno:
xmlDoc: array di byte del pdf da salvare come file;
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getPdfFromXml>
<arg0>
<documentType>100</documentType>
<xmlDoc>[byteArrayXML]</xmlDoc>
</arg0>
</ws:getPdfFromXml>
</soapenv:Body>
</soapenv:Envelope>
2.20. WS20 consente di scaricare il metadato di una fattura passiva dato il nome file
ATTENZIONE: I metadati sono disponibili dall'anno 2020
getMetadato:
Parametro in ingresso:
DocFeFilter:
utente: Utente;
nomeFile: Nome File fattura passiva
Valore di ritorno:
Oggetto contenente il metadato serializzato in byte il nome file e il link relativo
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getMetadato>
<arg0>
<utente>
<username>utente</username>
<password>password</password>
<codiceAzienda>azienda</codiceAzienda>
</utente>
<nomeFile>IT00000000000_XXXXX.xml</nomeFile>
</arg0>
</ws:getMetadato>
</soapenv:Body>
</soapenv:Envelope>
2.21. WS21 consente di ottenere la lista dei pacchetti in quel momento attivi nel profilo
getPacchettiAttivi:
Parametro in ingresso:
utente: Utente;
Valore di ritorno:
Lista di oggetti di tipo Pacchetto.
è possibile avere attivi piu pacchetti nello stesso cliente che possono avere data di scadenza diversa.
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getPacchettiAttivi>
<arg0>
<username>utente</username>
<password>password</password>
<codiceAzienda>azienda</codiceAzienda>
</arg0>
</ws:getPacchettiAttivi>
</soapenv:Body>
</soapenv:Envelope>
2.22. WS22 consente di impostare un documento come "non scaricato"
resetDownloadFlag:
Parametro in ingresso:
utente: Utente;
nomeFile: stringa
Valore di ritorno:
esito: 0 procedura andata a buon fine
esit0: 1 documento non trovato
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:resetDownloadFlag>
<arg0>
<utente>
<username>utente</username>
<password>password</password>
<codiceAzienda>azienda</codiceAzienda>
</utente>
<nomeFile>IT012345678910_abcde.xml</nomeFile>
</arg0>
</ws:resetDownloadFlag>
</soapenv:Body>
</soapenv:Envelope>
2.23. WS23 consente di ottenere gli ordini nso ricevuti nella piattaforma
NOTA: non essendo presente la pagina per fare il reset del flag "scaricato" è necessario usare la funzione resetDownloadFlag (WS22)
getOrdiniNSORicevuti:
Parametro in ingresso:
utente: Utente;
Valore di ritorno:
Lista di oggetti: <DocFe>: lista dei documenti restituiti:
DocFe.code: codice del documento, (numero)
DocFe.date: data del documento
DocFe.docData: array di byte
DocFe.docName: nome del file xml o p7m
DocFe.lastUpdate: data ricezione documento.
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getOrdiniNSORicevuti>
<arg0>
<username>utente</username>
<password>password</password>
<codiceAzienda>azienda</codiceAzienda>
</arg0>
</ws:getOrdiniNSORicevuti>
</soapenv:Body>
</soapenv:Envelope>
2.24. WS24 consente di scaricare le fatture passive ricevute con l'eventuale firma digitale già rimossa
ATTENZIONE: Impostato un limite massimo di 20 fatture prelevabili con una singola request. Se si hanno un numero superiore di fatture a disposizione andranno fatte più request
getFeRicevuteNoFirma:
consente di scaricare le fatture passive ricevute con l'eventuale firma digitale già rimossa.
Parametro in ingresso:
DocImportPaItem:
utente: credenziali dell'azienda per cui si stanno scaricando i documenti, di seguito i campi da valorizzare:
utente.codiceAzienda, codice azienda della si sta caricado la fattura
utente.username
utente.password
fileName: valorizzando questo parametro verra scaricata la fattura con quel nome ignorando il fatto che siano state gia scaricate
Valore di ritorno:
Lista di oggetti: <DocFe>: lista dei documenti restituiti:
DocFe.code: codice del documento, (numero)
DocFe.date: data del documento
DocFe.docData: array di byte
DocFe.docName: nome del file xml o p7m
DocFe.lastUpdate: data ricezione documento.
REQUEST SOAP:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eportale.eu/">
<soapenv:Header/>
<soapenv:Body>
<ws:getFeRicevuteNoFirma>
<arg0>
<utente>
<username>gamma</username>
<password>gamma</password>
<codiceAzienda>Gamma</codiceAzienda>
</utente>
</arg0>
</ws:getFeRicevuteNoFirma>
</soapenv:Body>
</soapenv:Envelope>
3. Esempi di codice
3.1. PHP
ATTENZIONE: è possibile incorrete in un errore di questo tipo: Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host. La certification authority che ha deprecato alcune versioni software, per risolvere il problema con PHP è sufficiente disattivare la validazione del certificato da parte di PHP con questo script, naturalmente la crittografia SSL rimane attiva
$context = stream_context_create([
'ssl' => [
// set some SSL/TLS specific options
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
]);
$client = new SoapClient('cloud_fatturaElettronica.wsdl', ['stream_context' => $context]);
3.1.1. getAzienda
<?php
$client = new SoapClient('sandbox_fatturaElettronica.wsdl');
$client->__getFunctions();
$client->__getTypes();
$utente = array(
'codiceAzienda' => 'Gamma',
'username' => 'gamma',
'password' => 'gamma',
);
$ddc = array (
'arg0' =>
array('date' => null,
'utente' => $utente,
'signAndSand' => false,
'fileName' => null,
'xmlDoc' => null,
'dateLong' => null
),
);
$response = $client->getAzienda($ddc);
print("<pre>".print_r($response,true)."</pre>");
?>
3.1.2. getFeRicevute
<?php
$client = new SoapClient('sandbox_fatturaElettronica.wsdl');
$client->__getFunctions();
$client->__getTypes();
$utente = array(
'codiceAzienda' => 'Gamma',
'username' => 'gamma',
'password' => 'gamma',
);
$ddc = array (
'arg0' =>
array('date' => '2018-11-14',
'utente' => $utente,
'signAndSand' => false,
'fileName' => null,
'xmlDoc' => null,
'dateLong' => null
),
);
$response = $client->getFeRicevute($ddc);
print("<pre>".print_r($response,true)."</pre>");
?>
3.1.3. getNotificheList
<?php
$client = new SoapClient('sandbox_fatturaElettronica.wsdl');
$client->__getFunctions();
$client->__getTypes();
$ddc = array (
'arg0' =>
array(
'aziendaCod' => 'Gamma',
'utenteCod' => 'gamma',
'fileName' => 'IT00934061003_00118.xml'
),
);
$response = $client->getNotificheList($ddc);
print("<pre>".print_r($response,true)."</pre>");
?>
3.1.4. getDocNomeFile
<?php
$client = new SoapClient('sandbox_fatturaElettronica.wsdl');
$client->__getFunctions();
$client->__getTypes();
$utente = array (
'codiceAzienda' => 'Gamma',
'username' => 'gamma',
'password' => 'gamma',
);
$ddc = array (
'arg0' =>
array('dateDal' => '2019-01-01',
'dateAl' => '2019-01-31',
'utente' => $utente
),
);
$response = $client->getDocNomeFile($ddc);
print("<pre>".print_r($response,true)."</pre>");
?>
3.2. C#
3.2.1. getNotificheList
protected void Page_Load(object sender, EventArgs e)
{
var fatturaElettronicaServiceClient = new FatturaElettronicaServiceClient();
var notPar = new notificaParam();
notPar.aziendaCod = "Gamma";
notPar.utenteCod = "gamma";
notPar.fileName = "IT00934061003_00118.xml"; // è possibile passare una lista di file passando i nomi dei file separati da "|" pipe
var notifiche = fatturaElettronicaServiceClient.getNotificheList(notPar);
GridView1.DataSource = notifiche;
GridView1.DataBind();
}
3.2.2. getAzienda
protected void Page_Load(object sender, EventArgs e)
{
var fatturaElettronicaServiceClient = new FatturaElettronicaServiceClient();
var uut = new utente();
uut.codiceAzienda = "Gamma";
uut.username = "gamma";
uut.password = "gamma";
var ddc = new docImportPaItem();
ddc.utente = uut;
azienda a = fatturaElettronicaServiceClient.getAzienda(ddc);
String.Format("{0} {1} {2} {3}", "Chiamata avvenuta con successo", a.azienda1, a.codFisc, a.iva);
}
3.2.3. importFeAttivo
protected void Page_Load(object sender, EventArgs e)
{
var fatturaElettronicaServiceClient = new FatturaElettronicaServiceClient();
var uut = new utente();
uut.codiceAzienda = "Gamma";
uut.username = "gamma";
uut.password = "gamma";
byte[] file = File.ReadAllBytes(@"C:\Users\Diego\Desktop\FATTURE XML\ITBRNMSM71B24E463Y_00100.xml");
ddc.fileName = "IT01222160119_00093.xml";
ddc.xmlDoc = file;
ddc.signAndSand = true;
var importFeAttive = fatturaElettronicaServiceClient.importFeAttivo(ddc);
}
3.3. VISUAL BASIC
3.3.1. getAzienda
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' GET AZIENDA PER OTTENERE I DATI DELL'AZIENDA E SOPRATTUTTO I CREDITI RESIDUI
Dim fatturaElettronicaService As New FatturaElettronicaServiceClient
Dim uut As New utente
uut.codiceAzienda = "Gamma"
uut.username = "gamma"
uut.password = "gamma"
Dim ddc As New docImportPaItem
ddc.utente = uut
Dim a As New azienda
Try
a = fatturaElettronicaService.getAzienda(ddc)
MessageBox.Show(String.Format("Connesso a {0}, Crediti: {1}", a.azienda1, a.crediti))
Catch ex As Exception
MessageBox.Show("Errore: " & ex.Message)
End Try
End Sub
3.3.2. importFeAttivo
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'UPLOAD FILE XML
Dim fatturaElettronicaService As New FatturaElettronicaServiceClient
Dim uut As New utente
uut.codiceAzienda = "Gamma"
uut.username = "gamma"
uut.password = "gamma"
Try
Dim ddc As New docImportPaItem
ddc.utente = uut
Dim f As New OpenFileDialog
If f.ShowDialog = DialogResult.OK Then
ddc.fileName = f.SafeFileName
ddc.xmlDoc = File.ReadAllBytes(f.FileName)
ddc.signAndSand = True
Dim info As New eportaleInfo
info = fatturaElettronicaService.importFeAttivo(ddc)
MessageBox.Show(String.Format("Esito {0}, Descrizione: {1}", info.esito, info.descrizione))
End If
Catch ex As Exception
MessageBox.Show("Errore: " & ex.Message)
End Try
End Sub
3.3.3. getNotificheList
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'NOTIFICHE REALTIVE AD UN FILE
Dim fatturaElettronicaService As New FatturaElettronicaServiceClient
Dim notPar As New notificaParam
notPar.aziendaCod = "Gamma"
notPar.utenteCod = "gamma"
notPar.fileName = "IT00934061003_00118.xml" 'è possibile passare una lista di file passando i nomi dei file separati da "|" pipe
Dim notificaRequest1 As notificaRequest()
notificaRequest1 = fatturaElettronicaService.getNotificheList(notPar)
MessageBox.Show(notificaRequest1.Length)
End Sub
3.4. DELPHI
3.4.1. getAzienda
implementation
uses sandbox_fatturaElettronica;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Service: FatturaElettronicaService;
ReqEmployee: docImportPaItem;
ResEmployee: Azienda;
Ute: Utente;
begin
Memo1.Lines.Clear;
// capture interface to service
Service := getFatturaElettronicaService();
// build the request
ReqEmployee := docImportPaItem.Create;
try
try
Ute := Utente.Create;
Ute.codiceAzienda := 'Gamma';
Ute.username := 'gamma';
Ute.password := 'gamma';
ReqEmployee.utente := Ute;
// Make the service request
ResEmployee := Service.getAzienda(ReqEmployee);
try
try
// Display the response
Memo1.Lines.Add('Azienda: '+ResEmployee.azienda);
Memo1.Lines.Add('Crediti: '+inttostr(ResEmployee.crediti));
except
on E: exception do Memo1.Lines.Add('Errore '+E.Message);
end;
finally
Ute.Free;
ResEmployee.Free;
end;
except
on E: exception do Memo1.Lines.Add('Errore '+E.Message);
end;
finally
ReqEmployee.Free;
end;
end;
3.5. Configurazioni
3.5.1. Importazione in progetti con la versione del Framework .NET precedente alla 4.0
Questa è la configurazione corretta da inserire in App.Config o in Web.Config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="FatturaElettronicaServiceServiceSoapBinding"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="999999"
maxBufferPoolSize="999999"
maxReceivedMessageSize="999999"
messageEncoding="Text"
textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="999999"
maxStringContentLength="999999"
maxArrayLength="999999"
maxBytesPerRead="999999"
maxNameTableCharCount="999999" />
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://cloud.eportale.eu/service-ejb/FatturaElettronicaService"
binding="basicHttpBinding" bindingConfiguration="FatturaElettronicaServiceServiceSoapBinding"
contract="ServiceReference1.FatturaElettronicaService" name="FatturaElettronicaServicePort" />
</client>
</system.serviceModel>