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

Antonio Musarra

I began my journey into the world of computing from an Olivetti M24 PC ( 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...

TIBCO JasperReports Server & JBoss EAP 7.2Come installare Liferay 7.2 GA2 su WildFly 16 + Oracle Database 19c

In questo video tutorial vi mostrerò come installare step-by-step TIBCO Jasper Reports Server 7.5 Community Edition su RedHat JBoss EAP 7.2, utilizzando CentOS 8.1 come sistema operativo e PostgreSQL come database server.

Vedremo come affrontare l'installazione di Jasper Reports Server senza l'ausilio dell'installer; questa è l'opzione solitamente adottata in ambiti enterprise. I punti salienti di questo tutorial sono:

  • Quali sono i requisiti software
  • Quali sono i requisiti hardware
  • Download del software
  • Layout d’installazione
  • Installazione di OpenJDK 11
  • Installazione di PostgreSQL 10
  • Installazione di JBoss EAP 7.2.0
  • Configurazione & Installazione di Jasper Reports Server
  • Configurazione di JBoss EAP 7.2.0
  • Start di Jasper Reports Server