Coder Social home page Coder Social logo

Comments (3)

ahmedissa avatar ahmedissa commented on August 14, 2024

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.

frebos88 avatar frebos88 commented on August 14, 2024

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.

ahmedissa avatar ahmedissa commented on August 14, 2024

Sorry, but i don't know, when they will update it. I use a private fork.

from validate-vat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.