Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

handsoap

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handsoap

A (really) simple soap client

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

handsoap

Basic Usage

const handsoap = require('handsoap');

const url = 'MY URL';
const body = {
  some: {
    data: 'here'
  }
};

const options = {
  httpHeaders: {
    http: 'Header'
  },
  soapHeaders: {
    soap: 'Header'
  },
  namespaces: [
    'MyNameSpace': 'My.Name.Space',
    'MyNameSpace2': 'My.Name.Space.2'
  ]
}

handsoap.request(url, operation, action, body, options, auth).then((response) => {
  // Success
}, (err) => {
  // Error
});

Wrapper Example

// definition
const handsoap = require('handsoap');

HandSoapWrapper = function(url, options, auth) {
  this.url = url;
  this.options = options;
  this.auth = auth;
};

HandSoapWrapper.prototype._wrapRequest = function(operation, action, body) {
  return handsoap.request(this.url, operation, action, body, this.options, this.auth);
}

HandSoapWrapper.prototype.myOperation = function(body) {
  const operation = 'ns1:MyOper';
  const action = 'MyAction';
  return this._wrapRequest(operation, action, body);
}


// usage
const url = 'MY URL';

const options = {
  httpHeaders: {
    http: 'Header'
  },
  soapHeaders: {
    soap: 'Header'
  },
  namespaces: [
    'MyNameSpace': 'My.Name.Space',
    'MyNameSpace2': 'My.Name.Space.2'
  ]
};

const auth = {
  user: 'user',
  pass: 'pass'
};

const handSoapWrapper = new HandSoapWrapper(url, options, auth);

handSoapWrapper.myOperation(body).then((response) => {
  // Success
}, (err) => {
  // Error
});

Keywords

FAQs

Package last updated on 01 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc