Registry / http-networking / soap
library0.0.1rc0jsnpmunverified

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 soap
INSTALL
IMPORT
SIG · SOAP
S
soap
http-networkingjavascriptv0.0.1rc0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createClientAsync
import { createClientAsync } from 'soap';
const { createClientAsync } = require('soap');
Preferred for modern async/await patterns to create a SOAP client. The callback-based `createClient` is also available.
listen
import { listen } from 'soap';
const { listen } = require('soap');
Used to create a new SOAP server instance on an existing Node.js HTTP(S) server.
WSSecurity
import { WSSecurity } from 'soap';
const { WSSecurity } = require('soap');
One of several security classes (e.g., BasicAuthSecurity, NTLMSecurity) for configuring SOAP message security.
Client
import type { Client } from 'soap';
Type import for the SOAP client instance, useful for TypeScript projects.

Demonstrates asynchronous SOAP client creation, calling a service method (Add), and basic error handling with security options.

import { createClientAsync, BasicAuthSecurity, Client } from 'soap'; async function consumeWebService() { const wsdlUrl = 'http://www.dneonline.com/calculator.asmx?WSDL'; // Public test WSDL let client: Client | undefined; try { client = await createClientAsync(wsdlUrl); console.log('SOAP client initialized successfully.'); // Optional: Add security headers if required by the service // client.setSecurity(new BasicAuthSecurity('username', 'password')); // You can inspect available methods and types: // console.log(client.describe()); // Call a method, e.g., 'Add' from the Calculator service const args = { intA: 10, intB: 5 }; console.log(`Calling 'Add' method with arguments: ${JSON.stringify(args)}`); const result = await client.AddAsync(args); console.log('Result from SOAP service (Add):', result[0].AddResult); } catch (error) { console.error('Error consuming SOAP web service:', error instanceof Error ? error.message : error); // For detailed debugging, inspect the last request/response if (client) { console.error('Last Request (XML):', client.lastRequest); console.error('Last Response (XML):', client.lastResponse); } } } consumeWebService();
Debug
Known issues
breakingThe package now officially requires Node.js version 20.19.0 or higher. Running on older Node.js versions may lead to unexpected errors, build failures, or compatibility issues.
fix
Upgrade your Node.js environment to version 20.19.0 or later to ensure compatibility and stability.
affects: >=1.9.0
gotchaThe internal URL parsing mechanism was updated in v1.9.0 to use the modern WHATWG URL API, replacing the deprecated `url.parse`. While this generally improves compliance with web standards, it might introduce subtle behavioral differences for malformed or non-standard WSDL/endpoint URLs that previously worked under `url.parse`'s more lenient parsing.
fix
Ensure that all WSDL and SOAP endpoint URLs are well-formed and adhere to WHATWG URL standards. Thoroughly test existing integrations after upgrading.
affects: >=1.9.0
gotchaSeveral transitive dependencies, including `glob`, `js-yaml`, `qs`, and `body-parser`, have received security updates across various minor versions. While `node-soap` addresses these promptly, users should regularly update their `node-soap` package to mitigate potential supply chain vulnerabilities from these underlying libraries.
fix
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.
affects: >=1.6.1
gotchaThe `lodash` dependency was entirely removed in version 1.7.0 to reduce the package's footprint. If your project indirectly relied on `lodash` through `node-soap`'s transitive dependencies for other functionalities, you might now encounter runtime errors.
fix
Review your project's direct and indirect `lodash` usage. If necessary, add `lodash` as a direct dependency to your project: `npm install lodash`.
affects: >=1.7.0
Errors
Common errors & fixes
TypeError: soap.createClientAsync is not a function
This error typically indicates an incorrect import statement (e.g., using CommonJS `require` syntax with an ESM module) or incorrect destructuring of the imported module.
fix
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.
Error: WSDL not found: [your-wsdl-url]
The provided WSDL URL is inaccessible, incorrect, or the network connection to it is failing. This can also occur if the WSDL requires specific authentication headers that were not applied before `createClientAsync` attempts to fetch it.
fix
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.
SOAP Fault: <faultcode>...</faultcode><faultstring>...</faultstring>
This is an application-level error returned by the SOAP web service itself, indicating a problem with the request parameters, business logic, or an internal server-side issue.
fix
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.
TypeError: client.yourMethodName is not a function
The method name you are attempting to call is either incorrect, case-sensitive, or the WSDL was not fully parsed, meaning the client object does not recognize that method.
fix
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.
Upgrade
Version history
0.0.1rc0latest on npm
Audit
Dependencies
axiosrequiredUsed internally for making HTTP/HTTPS requests to SOAP endpoints.
saxrequiredLightweight XML parser used for handling SOAP envelopes.
expressoptionalRequired for running the SOAP server functionality.
body-parseroptionalUsed by the SOAP server to parse incoming request bodies.
Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
1
Resources
soap — npm install soap · libregistry