VIES Check Vat: C# Client Example

1. Overview

You can verify the validity of a VAT number issued by any Member State by the European Information Exchange System (VIES) system for validation of VAT numbers. For more information on this service please visit VIES VAT number validation

The VIES has publicly exposed this service through the SOAP protocol. The service is called checkVatService and the WSDL document is located at the following address WSDL checkVatService.

This C# project implements a simple SOAP client to use the VIES services. You can found this project on VIESCheckVatService repository.

 

2. Project details

The project is divided into two sub-projects:

  • VIESCheckVatService : Contains the SOAP proxy class and some interfaces and classes of boundary.
  • VIESCheckVatServiceClient : It contains a simple Windows application that uses the service via the VIES SOAP client.

Figure 1 shows the classes and interfaces created to interact with the service. In detail:

  • IVIESCheckVatService : Generically defines the interface for interaction with the services VIES.
  • VIESCheckVatServicesSOAPImpl : Class that implements the interface defined above. This class is specific to interact via SOAP.
  • VIESCheckServiceFactory : Factory class that returns the correct implementation of the client that interacts with the services VIES. The implementation is supported SOAP.
  • VIESVatModel : This class represents the set of data returned by the service VIES.
Figure 1. Class Diagram of the VIESCheckVatService

Figure 1. Class Diagram of the VIESCheckVatService

 

Please find below an example of C # code that shows the use of the VIES service.

 

Source Code 1. Example C# client code that use VIES service

 

Figure 2. Validation VAT number OK

Figure 2. Validation VAT number OK

 

Figure 3. Validation VAT number FAILED

Figure 3. Validation VAT number FAILED

 

Figure 4. Validation VAT number field required

Figure 4. Validation VAT number field required

 

Figure 5. Validation VAT number

Figure 5. Validation VAT number

 

Figure 6. Validation VAT number FAILED for SOAP Fault

Figure 6. Validation VAT number FAILED for SOAP Fault

 

The following figures show the windows application (available in the project) that interacts with the VIES service.  FAILED for network problems  The project was developed using the SharpDevelop tool (version 4.4). In addition, the project has been tested and run on the platform. NET 4.

 

3. Notes

To use the service you are invited to read the document Specific disclaimer for this service issued by the European Commission.

 

4. Resources

Liferay Portal Security AuditCos'è e come funzione il framework di Security Audit

Vi siete mai chiesti cos'è e come funziona il sistema di Security Audit di Liferay? Ho cercato di rispondere alla domanda non soffermandomi solo al "cosè e come funziona", sono andato ben oltre. Non vi resta che leggere questo EBook per scoprire.

Ottieni il tuo EBook

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC (http://it.wikipedia.org/wiki/Olivetti_M24) bought by my father for his work. Day after day, quickly taking control until … Now doing business consulting for projects in the enterprise application development using web-oriented technologies such as J2EE, Web Services, ESB, TIBCO, PHP.

You may also like...

Liferay SSL/TLS SecurityCome configurare il bundle Liferay per abilitare il protocollo SSL/TLS

Sei curioso di scoprire come configurare il bundle Liferay per funzionare in modalità sicura tramite protocollo SSL/TLS? In questo eBook ( #LFRDEPGUIDE ) ti spiego come farlo step-by-step; per il bundle Apache Tomcat e WildFly. Ricorda di lasciare un tuo feedback dopo averlo letto.