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

Vies Response Error #27

Open
Thazar opened this issue Oct 29, 2021 · 6 comments
Open

Vies Response Error #27

Thazar opened this issue Oct 29, 2021 · 6 comments

Comments

@Thazar
Copy link

Thazar commented Oct 29, 2021

Hey, after validateVat, the response from the vies is: 'ViesClientError: Failed to parse vat validation info from VIES response'. Any sugestions?

@stupkad
Copy link

stupkad commented Nov 3, 2021

Hi there,

I experienced the same issue, I am using my own code based on this library, but not exactly this library. To fix this issue, I did the following two things:

  1. The regex used in hasFault does not work, as there is some whitespace including linefeeds.
const hasFault = (soapMessage: string): boolean => {
    return soapMessage.match(/<soap:Fault>(.|\s)*<\/soap:Fault>/g) !== null;
};
  1. There is an issue with the request headers, I changed them as follows. Problem is the SOAPAction from the request headers, which has to be removed at all.
const headers = {
    "Content-Type": "application/xml",
    "User-Agent": "node-soap",
    "Accept": "text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8",
    "Accept-Encoding": "none",
    "Accept-Charset": "utf-8",
    "Connection": "close",
    "Host": "ec.europa.eu"
};

Cheers,
Dietmar

@florianmrz
Copy link

This was already fixed in the "non-TS" version of this package: https://github.com/viruschidai/validate-vat

You can use it as a workaround until it was fixed here as well.

@thebillg
Copy link
Contributor

@jpagex
Copy link

jpagex commented Nov 30, 2021

Any plan on releasing the fix?

@AllanJard
Copy link

Looks like it was in 1.2.1. Its working for me :). I'd say this can be closed.

@jpagex
Copy link

jpagex commented Feb 21, 2022

Looks like it was in 1.2.1. Its working for me :). I'd say this can be closed.

I did not see any tag/release on this repo, so I assumed it was not yet released. It seems to be deployed on npm though with the correct commit hash.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants