Node-SOAP is a robust and minimal JavaScript library designed for interacting with SOAP web services, offering both client-side and server-side functionalities. Currently at stable version 1.9.1, the project maintains a regular release cadence focused on dependency updates, security patches, and minor enhancements, typically releasing new versions every few weeks or months. Its key differentiators include comprehensive support for various SOAP security mechanisms such as BasicAuth, WS-Security, and NTLM, and a flexible API that supports both callback-based and modern promise-based interactions with WSDL-defined services. The library ships with TypeScript types, making it well-suited for contemporary Node.js applications. It targets Node.js versions 20.19.0 and higher.
npm install soapVerified import paths — ran on the pinned version, not inferred.
Demonstrates asynchronous SOAP client creation, calling a service method (Add), and basic error handling with security options.
Upgrade your Node.js environment to version 20.19.0 or later to ensure compatibility and stability.
Ensure that all WSDL and SOAP endpoint URLs are well-formed and adhere to WHATWG URL standards. Thoroughly test existing integrations after upgrading.
Keep `node-soap` updated to the latest minor or patch version using `npm update soap` to ensure you benefit from the most recent security fixes.
Review your project's direct and indirect `lodash` usage. If necessary, add `lodash` as a direct dependency to your project: `npm install lodash`.
Ensure you are using `import { createClientAsync } from 'soap';` in ESM contexts. If your project uses CommonJS, you might need to use `const soap = require('soap');` and then `soap.createClientAsync` or check module compatibility.Verify the WSDL URL is correct and publicly accessible from your Node.js environment. Check network connectivity, proxy settings, and any required HTTP authentication that might be necessary to retrieve the WSDL.
Examine the `faultstring` and `faultcode` within the error message for specific details. Review your request arguments against the service's WSDL documentation for expected inputs. Use `client.lastRequest` to inspect the exact XML sent to the server.
Verify the method name against the WSDL (use `client.describe()` to programmatically see available services, ports, and methods). Ensure the client was successfully created and the WSDL fully loaded before attempting to call methods.