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

soap

Package Overview
Dependencies
Maintainers
0
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

soap

A minimal node SOAP client

  • 1.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
354K
decreased by-15.61%
Maintainers
0
Weekly downloads
 
Created

What is soap?

The 'soap' npm package is a SOAP client and server library for Node.js. It allows you to create SOAP clients to consume web services and also create SOAP servers to expose your own web services.

What are soap's main functionalities?

Create a SOAP Client

This feature allows you to create a SOAP client that can consume a SOAP web service. You provide the WSDL URL, and the client can then call the web service methods.

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

Create a SOAP Server

This feature allows you to create a SOAP server that exposes your own web service. You define the service and its methods, and provide the WSDL file.

const soap = require('soap');
const express = require('express');
const app = express();
const myService = {
  MyService: {
    MyPort: {
      MyFunction: function(args) {
        return { name: args.name };
      }
    }
  }
};
const xml = require('fs').readFileSync('myservice.wsdl', 'utf8');
soap.listen(app, '/wsdl', myService, xml);
app.listen(8000);

Handle SOAP Headers

This feature allows you to add custom SOAP headers to your SOAP client requests. This can be useful for authentication or other custom header requirements.

const soap = require('soap');
const url = 'http://example.com/wsdl?wsdl';
soap.createClient(url, function(err, client) {
  if (err) throw err;
  const soapHeader = { 'MyHeader': 'value' };
  client.addSoapHeader(soapHeader);
  client.MyFunction({name: 'value'}, function(err, result) {
    if (err) throw err;
    console.log(result);
  });
});

Other packages similar to soap

Keywords

FAQs

Package last updated on 03 Nov 2024

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