1.7.1 • Published 3 years ago

@radekborandom/soap-client v1.7.1

Weekly downloads
12
License
ISC
Repository
github
Last release
3 years ago

soap-client

A minimalistic soap messaging protocol client created for node.js

Install

   $ yarn add @radekborandom/soap-client
  • Install with npm

   $ npm i @radekborandom/soap-client

Client initialization

await soapClient.generateClient(wsdlUrl) - Generate a new soap client for the web service specified in the wsdl document.

Parse provided WSDL document. Generate methods from the operations defined in it.

const soapClient = require("soap-client");
// your app code
const client = await soapClient.generateClient(
  "http://example.com/wsdl/service.wsdl"
);

Sending a soap message

await client.operationName({...args}) - Perform one of the operations defined in the WSDL

Call a particular method to perform operation defined in the WSDL document. Name of the method is the same as the name of operation to be performed. Response is parsed and returned either as a primitive value (if soap response body has only one field) or as a object.

const soapClient = require("soap-client");
// your app code
const client = await soapClient.generateClient(
  "http://example.com/wsdl/service.wsdl"
);
const response = await client.methodName({ ...args });

Security

Currently only the UsernameToken method of authentication is supported.

client.addUsernameToken(username, password) - Adds the UsernameToken to client instance

Generate header with UsernameToken to be appended to each request/operation performed by this instance.

const soapClient = require("soap-client");
// your app code
const client = await soapClient.generateClient(
  "http://example.com/wsdl/service.wsdl"
);
client.addUsernameToken("your_username", "your_password");
1.7.1

3 years ago

1.7.0

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago