Forum Discussion

SuperFiets_'s avatar
SuperFiets_
Helper I
3 years ago
Solved

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?

5 Replies

    • SuperFiets_'s avatar
      SuperFiets_
      Helper I

      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.

      • lbendlin's avatar
        lbendlin
        Super User

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

         

        Do you need the Power Query code?

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi SuperFiets_ ,

     

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


    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.