Using European VAT Verification SOAP Service

Did you check MBS Plugins?
There are two VAT check example projects included with main part. (As they don’t use plugins)

The SOAPServer.Post should not go against WSDL, but against the endpoint.

Ok nice sound.
VAR or TIN same way.

Could you try to give me the link please?
This one above doesn’t work.

Regards

Franch, also if you want the SOAP method can be invoked as in the following code:

[code]// New SOAPMethod(“http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl”)
Dim sm As New SOAPMethod
sm.timeout = 10

dim sr as soapResult

// create soap method and define parameters
sm = new SOAPMethod
sm.parameter(“countryCode”) = “EL”
sm.parameter(“vatNumber”) = “999445290”

// setup method properties
sm.methodNamespace = “urn:ec.europa.eu:taxud:vies:services:checkVat:types”
sm.timeout = 20
sm.url = “http://ec.europa.eu/taxation_customs/vies/services/checkVatService.wsdl” // works also without the .wsdl

// call the method
sr = sm.invoke(“checkVat”)[/code]

In the sr you get the result which contains the data you are after…

It works for VAT in your example.

If you take the informations for TIN (URN & URL), it doesn’t work.
Weird.

I’ve took my old code which worked fine in start of my project and today it doesn’t work.

[code]
Dim sm as New SOAPMethod
Dim sr as SOAPResult

sm.Parameter(“countryCode”) = Uppercase(country.text) // Country : AT
sm.Parameter(“tinNumber”) = tin.text // Tin number : 999/9999
sm.methodNamespace = “urn:ec.europa.eu:taxud:tin:services:checkTin:types”
sm.timeout = 20
sm.url=“https://ec.europa.eu/taxation_customs/tin/checkTinService

sr = sm.Invoke(“checkTin”)
If sr.error = True then
MsgBox "ERROR: " + sr.errorMessage
End if

If sr.result(“validStructure”) = “false” Then
MsgBox sr.result(“validStructure”)
End If

If sr.result(“validStructure”) = “true” Then
MsgBox sr.result(“validStructure”)
End If[/code]

The look of this code is so similar than your code.
I don’t understand why.
This code is so simple. :confused:

XLMException returns this:
msg:XML parser error 7: mismatched tag at Line : 1
sr : Nil

I could think that, if it worked before, it should work today.
I use 2015r3.1FC Maybe that…

Maybe use HTTPSocket directly?
Or our CURL Plugin?

Same with HTTPSocket Christian.
Look at some posts above.
I send the SOAP request, but the website returns no value, and says :

[code]…/…

.../... Sorry, the page you wanted isn't here[/code]

I’m locked right now :frowning:

This is crazy because on the same website, the VAT web service works fine, and using soapUI both work also fine.
I can think that, some changes has been made only on this website, but in any case, i can’t use it with Xojo.

About Curl, i’ve not the possibility to make some test.
I need to buy this plugin, and if it would not work too, i will lose $49 + VAT.

In another hand, Xojo is able to handle SOAP (basic). but why not more again?
Buy a MBS plugin for $999 is too expensive for me, :frowning:
You should agree with me on this point i guess. :wink:

For me the checkVat service works and it returns the Company Name, and the Address (if the vat number / country is valid, else it returns that it is invalid).

What is the difference between the checkVat and the checkTin?

did you try the project I made for my plugins?
I use this VAT check here every day…

for VAT query I just send the right XML to the right server via CURL or HTTPSocket.
No need for SOAP Kit for just one query.

The difference is URL for WDSL and the URN that’s all.
It check the TaxPayer Identification Number from a country.
This information could be in your ID card (for Belgium)

[quote=227746:@Christian Schmitz]for VAT query I just send the right XML to the right server via CURL or HTTPSocket.
No need for SOAP Kit for just one query.[/quote]
I’ve took this example in a document bought by a college.
It talked about XML and a small SOAP example using httpsocket also.

[quote=227747:@Franck Danard]The difference is URL for WDSL and the URN that’s all.
It check the TaxPayer Identification Number from a country.
This information could be in your ID card (for Belgium)[/quote]
Ah, now I get it. You need the TIN instead of the VAT number.

yes, i need TIN for the moment.

It seems to have a problem with the sm.url (not correct url?)
Do you have a link to the wsdl file?

WSDL URL ; https://ec.europa.eu/taxation_customs/tin/checkTinService.wsdl
It gives an URN : urn:ec.europa.eu:taxud:tin:services:checkTin

Frank I get an “mismatched tag error” when I try to invoke checkTin. Googling about this issue I got:

[quote]Get a CheckTinPortType by calling a properly initialized CheckTinService’s getCheckTinPort(), and use that to perform the call.

All the necessary classes are generated, you just need to perform the checkTin() call now with the appropriate parameters.[/quote]

Now it seems that calling the CheckTin Service is more complicated than calling the checkVAT service (but I might be mistaken). I don’t know if the above quote helps you…

ok thanks for your feedback.
It could be useful.