npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tjoussen/browser-soap

v1.0.9

Published

A minimal SOAP client in javascript, so tiny it even runs in browser

Downloads

12

Readme

Browser Soap

This module lets you connect to web services using SOAP, in pure javascript, using node or browser.

This module is forked from node module "[email protected]". Specific changes are:

  • You don't need jQuery anymore

Features (copied from [email protected] Readme.md):

  • Very simple API
  • Handles both RPC and Document schema types
  • Supports multiRef SOAP messages (thanks to @kaven276)
  • Support for both synchronous and asynchronous method handlers
  • WS-Security (currently only UsernameToken and PasswordText encoding is supported)

Install

Install with npm:

  npm install https://github.com/tjoussen/browser-soap

Browser

Then embed the file "./browser-soap-min.js"

<script src="browser-soap-min.js"></script>

Then you write code such as:

// in global scope:
this['browser-soap'].createClient("/ACMEWebService?WSDL", function(err, client) {
  if (!err)
    console.log(client);  // all methods are stored in client
});

Or in es6

import soap from 'browser-soap'

soap.createClient("/ACMEWebService?WSDL", function(err, client) {
  if (!err)
    console.log(client);  // all methods are stored in client
});

JSONP is not currently supported, but should be very simple to add...

Module

soap.createClient(url, callback) - create a new SOAP client from a WSDL url

  var soap = require('soap');
  var url = 'http://example.com/wsdl?wsdl';
  var args = {name: 'value'};
  soap.createClient(url, function(err, client) {
      client.MyFunction(args, function(err, result) {
          console.log(result);
      });
  });

Client

An instance of Client is passed to the soap.createClient callback. It is used to execute methods on the soap service.

Client.describe() - description of services, ports and methods as a JavaScript object

  client.describe() // returns
    {
      MyService: {
        MyPort: {
          MyFunction: {
            input: {
              name: 'string'
            }
          }
        }
      }
    }

Client.setSecurity(security) - use the specified security protocol (see WSSecurity below)

  client.setSecurity(new WSSecurity('username', 'password'))

Client.method(args, callback) - call method on the SOAP service.

  client.MyFunction({name: 'value'}, function(err, result) {
      // result is a javascript object
  })

Client.service.port.method(args, callback) - call a method using a specific service and port

  client.MyService.MyPort.MyFunction({name: 'value'}, function(err, result) {
      // result is a javascript object
  })

WSSecurity

WSSecurity implements WS-Security. UsernameToken and PasswordText/PasswordDigest is supported. An instance of WSSecurity is passed to Client.setSecurity.

  new WSSecurity(username, password, passwordType)
    //'PasswordDigest' or 'PasswordText' default is PasswordText

WSDL Options

  • flattenArray (default: true): If false, array child values will be processed as child node elements with its parent node name
  • childNodeMap (default: {}): Translate the parent node name into another alias which is used as name for child node values. Only used if flattenArray: false