Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SuperFiets_
Frequent Visitor

How to get a response from the VIES database API

Hi everyone,

 

I am trying to connect to the VIES database SOAP API. This database returns if a VAT-number is valid and known within the EU.

I want to implement this into a table, however that is step two.

 

For now I am just trying to figure out how to get the API to work and return the desired value.

 

This is what my current query looks like:

let
    SourceURL = "http://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl",

options = [ #"Accept-Encoding"= "gzip,deflate",
           SOAPAction="", 
            #"Content-Type"="text/xml;charset=UTF-8",
            #"Connection"="Keep-Alive"
          ],
WebContent = Web.Contents("http://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl", 
    [Content=Text.ToBinary("
    <?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv=#(0022)http://schemas.xmlsoap.org/soap/envelope/#(0022) xmlns:urn=#(0022)urn:ec.europa.eu:taxud:vies:services:checkVat:types#(0022)>
   <soapenv:Header/>
   <soapenv:Body>
      <urn:checkVat>
         <urn:countryCode>NL</urn:countryCode>
         <urn:vatNumber>810433941B01</urn:vatNumber>
      </urn:checkVat>
   </soapenv:Body>
</soapenv:Envelope>
"), 
Headers=options]) ,
XmlContent = Xml.Tables(WebContent)
in
    XmlContent

 

in the body I need to provide the countryCode and vatNumber, however the 'final' query just seems to show some metadata regarding the api, I do not get the desired response, being for example 'VAT valid'. 

 

Does anyone have any tips on how to get this to work?

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You are using the wrong URL.  checkVatTestService can only be used with VAT numbers 100 or 200, and only to test if the service is up.

 

By the way, the website uses a REST API instead. Much simpler.

 

https://ec.europa.eu/taxation_customs/vies/rest-api/ms/NL/vat/810433941B01

 

lbendlin_0-1664664979045.png

 

 

View solution in original post

5 REPLIES 5
v-henryk-mstf
Community Support
Community Support

Hi @SuperFiets_ ,

 

By 'VAT valid', are you referring to the following document:

vhenrykmstf_0-1664767920884.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

You are using the wrong URL.  checkVatTestService can only be used with VAT numbers 100 or 200, and only to test if the service is up.

 

By the way, the website uses a REST API instead. Much simpler.

 

https://ec.europa.eu/taxation_customs/vies/rest-api/ms/NL/vat/810433941B01

 

lbendlin_0-1664664979045.png

 

 

Hi,

 

Thanks for your response, the image you supplied is the exact api response I am looking for. 

Did you do this through Power BI? Or through something else?

 

Also where did you find the documentation or something similair saying that there is a REST API available? On the official site all I can find is documentation about a SOAP API.

I went to the website and examined the network traffic upon pressing the form button.

 

Do you need the Power Query code?

No thank you very much!

 

I figured it out with the link you supplied!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.