Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks if the VIES service is online and available #83

Closed
krzaczek opened this issue Nov 5, 2019 · 5 comments
Closed

Checks if the VIES service is online and available #83

krzaczek opened this issue Nov 5, 2019 · 5 comments
Assignees
Labels
bug refactoring Improving existing code for the better

Comments

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 5, 2019

There seems to be a new endpoint we could use to check if the VIES service is up and running.

For the SOAP service you may send your xml request by using the following WSDL link:

http://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl

and by using the below values (common for all Member States/ CountryCodes) for each required result:

“vatNumber” value=100, response= VALID

“vatNumber” value=200, response = INVALID

I'll will try to implement it.

@DragonBe
Copy link
Owner

This was also referenced in ticket #64 and what I learned from it was that it's only for testing purposes for client implementations. But you're absolutely right, this is a good addition for checking if the service is up and running. Awesome 👍

@Seldaek
Copy link
Contributor

Seldaek commented Nov 11, 2019

As far as I understand the main problem they have with uptime is that VIES is only an aggregator service, which then dispatches to country-based services depending on the VAT number you are validating. They don't have a centralized database. This means VIES can be "up" but validating a certain number will fail because that country's service is down. This is also shown on http://ec.europa.eu/taxation_customs/vies/help.html (see Unavailability Shifts).

Therefore I am not sure what the value is of knowing that VIES itself is up, as calling it might still fail.. IMO you are better off calling when you need it and retrying later if it fails.

@krzaczek
Copy link
Collaborator Author

@Seldaek I will have to check but since the service requires to send a country code along with the test vatNumbers (100, 200) maybe it actually checks the corresponding country database and not just the VIES service itself.

It should be easy to verify since the technical breaks for different counties are on different time of day. http://ec.europa.eu/taxation_customs/vies/help.html

VIES monitors all member states and You can see the current status here: http://ec.europa.eu/taxation_customs/vies/monitoring.html

@DragonBe DragonBe added bug refactoring Improving existing code for the better labels Mar 22, 2020
DragonBe added a commit that referenced this issue Apr 25, 2020
I have taken a look at this request to access the integration test service of VIES which were made in issue #64 and issue #83. I can conclude that yes, it is possible to access this test service of VIES for integration tests (issue #64), but I was not able to verify if a backend service of VIES was not accessible.

In my test case I used Germany as it was supposed to be "DE-Germany	Unavailable daily from 11:00 PM to 01:30 AM" as was stated on https://ec.europa.eu/taxation_customs/vies/help.html. But on https://ec.europa.eu/taxation_customs/vies/monitoring.html it shows green. Not sure if the information in the help page is still accurate since my normal and test SOAP calls all succeeded.
@DragonBe
Copy link
Owner

@krzaczek @Seldaek I've tested it locally and also by adding functionality to access the test integration service of VIES (see #109), but even for all countries I get no issues accessing them during "unavailable" time mentioned at the VIES help page. So, my guess is that at this point we need to monitor the downtime of a backend service to see how VIES responds.

The heartbeat functionality was created during the time VIES Soap service was taken offline for maintenance. So yes, VIES did go down from time-to-time.

@DragonBe
Copy link
Owner

Haha 😃 I got one… German VIES just failed on me while running automated tests.

1) DragonBe\Test\Vies\ValidatorTest::testArgumentValidationSucceedsForNonLatinArgumentValues with data set "German Trader Name" (array('DE', '811569869', 'DE', '811569869', 'Deutsche Bahn', 'AG', 'Potsdamer Platz 2', '10785', 'Berlin'))
DragonBe\Vies\ViesServiceException: Back-end VIES service cannot validate the VAT number "DE811569869" at this moment. The service responded with the critical error "MS_UNAVAILABLE". This is probably a temporary problem. Please try again later.

Maybe I should put a markTestSkipped for when we receive such a failure 🤔 or move the whole Soap service into a mock object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug refactoring Improving existing code for the better
Projects
None yet
Development

No branches or pull requests

3 participants