Last active
March 19, 2021 02:42
-
-
Save circa10a/f6f7c9d8d5e4118e6cf2202262b2fddf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const soapRequest = require('easy-soap-request'); | |
const fs = require('fs'); | |
// example data | |
const url = 'https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php'; | |
const sampleHeaders = { | |
'user-agent': 'sampleTest', | |
'Content-Type': 'text/xml;charset=UTF-8', | |
'soapAction': 'https://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl#LatLonListZipCode', | |
}; | |
const xml = fs.readFileSync('test/zipCodeEnvelope.xml', 'utf-8'); | |
// usage of module | |
(async () => { | |
const { response } = await soapRequest({ url: url, headers: sampleHeaders, xml: xml, timeout: 1000 }); // Optional timeout parameter(milliseconds) | |
const { headers, body, statusCode } = response; | |
console.log(headers); | |
console.log(body); | |
console.log(statusCode); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's what I would expect from a GET request. You need to hit the
/GetJob
endpoint I suspect. But I know nothing of this API. You would need to consult the maintainer or check for API consumption documentation