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

Uncaught SoapFault exceptions #14

Closed
jonathanmaron opened this issue Jul 1, 2015 · 5 comments
Closed

Uncaught SoapFault exceptions #14

jonathanmaron opened this issue Jul 1, 2015 · 5 comments

Comments

@jonathanmaron
Copy link
Contributor

On iterating through a long list (ca. 2,000 items) of VAT numbers, validating each, I have received all the following uncaught SoapFault exceptions.

PHP Fatal error: Uncaught SoapFault exception: [soap:Server] MS_MAX_CONCURRENT_REQ
in [..]/vies/src/Vies/Vies.php:229

PHP Fatal error: Uncaught SoapFault exception: [soap:Server] GLOBAL_MAX_CONCURRENT_REQ
in [..]/vies/src/Vies/Vies.php:229

PHP Fatal error: Uncaught SoapFault exception: [soap:Server] MS_UNAVAILABLE
in [..]/vies/src/Vies/Vies.php:229

@jonathanmaron jonathanmaron changed the title Two uncaught SoapFault exception Two uncaught SoapFault exceptions Jul 1, 2015
@jonathanmaron jonathanmaron changed the title Two uncaught SoapFault exceptions Uncaught SoapFault exceptions Jul 1, 2015
@DragonBe
Copy link
Owner

DragonBe commented Jul 1, 2015

Thank you for reporting this failure.

Yes, there's a limit on requests you can do on the soap service but it's not documented how many request can be made in what time period.

Let me see what I can do about it.

@jonathanmaron
Copy link
Contributor Author

I was actually more concerned that an uncaught SoapFault is thrown. Surely, the SoapFault should be caught by DragonBe\Vies\Vies, and a DragonBe\Vies\ViesException should be thrown?

I would have thought it is easier for the end user to try and catch only one specific exception in his/her application logic, than for a DragonBe\Vies\ViesException and a SoapFault.

Or am I the only one who would implement it that way?

What do you think?

@DragonBe
Copy link
Owner

DragonBe commented Jul 6, 2015

@jonathanmaron You're absolutely right. Well, the issue is created and marked as bug. If I can free up some time, I will fix it in the upcoming days.

@jonathanmaron
Copy link
Contributor Author

Fixed in #18

@jonathanmaron
Copy link
Contributor Author

To differentiate between exceptions caused by local code, and those from the back-end service VIES, it make sense to have two exceptions. The new example "examples/checkVatBatch.php" shows why this is important.

DragonBe added a commit that referenced this issue Jul 8, 2015
Fixed Issue #14 - Uncaught SoapFault exceptions
DragonBe added a commit that referenced this issue Jan 13, 2019
It seems that natural persons have 10 digits and the way the checksum is calculated differs from the way business identities are being calculated. I've found a solution in a Ruby VAT validation package [yolk/valvat](https://github.com/yolk/valvat).

In [their issue #14](yolk/valvat#14) they describe issues with validating Bulgarian VAT ID's and how they solved it. I have applied their working solution to ensure consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants