Giter Site home page Giter Site logo

node-foam's Introduction

foam

Simple SOAP client for NodeJS. This module was created because none of the existing SOAP modules (most modules depend of https://www.npmjs.org/package/soap) would work with a third-party partner WSDL. As SOAP is just a POST request over HTTP, foam bypasses the WSDL discovery and just posts the data to the endpoint (which anyhow performs better than using the WSDL).

foam process the message and serialize it in a SOAP envelope and body, and parse the XML response into a Javascript object.

Usage

npm install foam --save
var operation = 'CelsiusToFahrenheit'
    , namespace = 'http://www.w3schools.com/webservices/'
    , action = "http://www.w3schools.com/webservices/CelsiusToFahrenheit"
    , message = {'Celsius': '23'}
    , uri = namespace + 'tempconvert.asmx'
    ;

var foam = require('foam');

foam(uri, operation, action, message, {namespace: namespace},
  function (err, result) {
    console.log(result.CelsiusToFahrenheitResponse.CelsiusToFahrenheitResult);
  }
);

Parameters

  • uri - endpoint of the SOAP service
  • operation - SOAP operation
  • action - Soapaction http header
  • message - a Javascript object that will be serialised to XML
  • options - an options object

Options

  • header - optional SOAP header
  • namespace - optional xmlns namespace for the operation
  • namespaces - optional additional namespaces for the Envelope element
  • benchmark - set to true to log the request timing to the console, defaults false
  • rejectUnauthorized - set to false to accept invalid certificates
  • secureProtocol - set to specific ssl protocol e.g. SSLv3_method

node-foam's People

Contributors

jtblin avatar gcochard avatar

Watchers

Omar Cornejo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.