Comments (3)
you need to change Content-Type
headers =
'Content-Type': 'text/xml; charset=utf-8'
'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' : parsedUrl.hostname
Response changed too.
hasFault = soapMessage.match /<env:Fault>\S+<\/env:Fault>/g
if hasFault
ret =
faultCode: parseField 'faultcode'
faultString: parseField 'faultstring'
else
ret =
countryCode: parseField 'ns2:countryCode'
vatNumber: parseField 'ns2:vatNumber'
requestDate: parseField 'ns2:requestDate'
valid: parseField('ns2:valid') is 'true'
name: parseField 'ns2:name'
address: parseField('ns2:address').replace /\n/g, ', '
from validate-vat.
Thank you @ahmedissa, it does indeed work with your suggested changes.
Do you know if there are any plans to update the repository with the latest changes? I don't see a way to override headers programmatically, or am I missing something?
from validate-vat.
Sorry, but i don't know, when they will update it. I use a private fork.
from validate-vat.
Related Issues (20)
- Invalid country code for Greece HOT 4
- consult number HOT 1
- Make the script work in browser as well?
- Query: Can the transport be HTTPS? HOT 3
- Just getting following error: Failed to parseField countryCode HOT 3
- Validate call fails with "Error reading XMLStreamReader" HOT 4
- Use Promise HOT 5
- Error: The VAT database of the requested member country is unavailable, please try again later HOT 3
- Can i use async/await instead of cabllback? HOT 3
- How to process other countries HOT 2
- Error in install HOT 3
- Get "requestIdentifier" in the response?
- easy enhancement HOT 1
- CORS header 'Access-Control-Allow-Origin' missing HOT 4
- Error: "Failed to parseField countryCode" HOT 2
- How I can get more information in response object HOT 5
- Error: Failed to parseField countryCode HOT 8
- Can't resolve 'https' in '..\node_modules\validate-vat\lib' HOT 2
- CORS error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validate-vat.