Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

warseph/soap-as-promised

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This repo is archived and no longer mantained ⚠️

This library was created when existing libraries, like node-soap, were outdated and lacked support for promises. However, times have changed, and first-class promise support has been introduced.

Due to the advancements and lack of updates to this library, it is no longer recommended for use. For the best results, please use the *Async methods in the original library.

soap-as-promised Circle CI

Convert all node-soap methods to promises. Inspired by soap-q, but it doesn't add any suffix to methods, the client has the same interface as exposed by the original soap module.

Installation

npm install soap-as-promised

Usage

const soap = require('soap-as-promised');

soap.createClient('http://example.org/wsdl')
    .then((client) => client.myAwesomeSoapMethod({param: true}))
    .then((result) => console.log(`The result was: ${result}`))
    .catch((error) => console.error(`There was an error! ${error}`));

Important!

There are a couple of things that behave different from the original soap client:

  • Null responses return an object with like this {return: null, _rawResponse: "<SOAP RETURNED BY THE SERVICE>"}
  • String responses return an object like this: {return: 'String response', _rawResponse: "<SOAP RETURNED BY THE SERVICE>"}
  • When specifying endpoint as an extra parameter you need to pass the options parameter (at least null or {})

About

Convert all soap methods to promises. Inspired by soap-q.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published