phpsoap

MS_MAX_CONCURRENT_REQ - VIES VAT Validation


I want to confirm multiple addresses by using https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl.

For some reason, I keep getting the MS_MAX_CONCURRENT_REQ error. I understand the meaning of the error, but I can't understand why it keeps occurring so randomly. I have a sleep of 15 seconds after each call. I could filter out so far that the error occurs mainly with German VAT ID's.

How can I minimize this error without increasing the sleep time?

This is my current SOAPClient Setup.

        $client = new SoapClient('https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl', ['trace' => false,'keep_alive' => false]);
        $result = $client->checkVatApprox([
            'countryCode' => $countryCode,
            'vatNumber' => $vatNumber,
            'traderName' => $traderName,
            'traderStreet' => $traderStreet,
            'traderPostcode' => $traderPostcode,
            'traderCity' => $traderCity,
            'requesterCountryCode' => $requesterCountryCode,
            'requesterVatNumber' => $requesterVatNumber
        ]);

Solution

  • I realise this question is rather old already, but I was researching this issue myself and wanted to add the reason why it can seem to be random.

    It is not only your requests that are hitting a request limit.

    As I understand it, VoW has a limit, which you can reach yourself, but VIES's requests to the Member state / Northern Ireland national services can also reach a limit, set by the member state's systems.

    As per this source: https://viesapi.eu/vies-problems-with-verifying-companies-from-germany-de/

    Quote of the relevant part:

    [..] there is a limitation on the concurrent requests handled by VoW. There is a maximum number of concurrent requests the system can handle. If the system receives a new request and the maximum number of concurrent requests is reached, the request is rejected. The maximum number of concurrent requests is not linked to a specific IP. It is a global count across all users. In addition, the MAX Concurrent limitations addresses both the VoW overall as well as each Member State separately and for each type of validation request namely, Manual (INT), SOAP (API), REST (API) as well as BATCH. On request though from some National Administrations, we unfortunately cannot disclose the exact level of the thresholds in VoW.