forked from vpulim/node-soap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
executable file
·48 lines (48 loc) · 6.14 KB
/
package.json
File metadata and controls
executable file
·48 lines (48 loc) · 6.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
"name": "soap",
"version": "0.3.0",
"description": "A minimal node SOAP client",
"engines": {
"node": ">=0.8.0"
},
"author": {
"name": "Vinay Pulim",
"email": "v@pulim.com"
},
"dependencies": {
"node-expat": ">=1.6.1",
"request": ">=2.9.0",
"httpntlm": "https://github.com/btallman/node-http-ntlm/archive/v.9-alpha.tar.gz"
},
"repository": {
"type": "git",
"url": "https://github.com/milewise/node-soap.git"
},
"main": "./index.js",
"directories": {
"lib": "./lib"
},
"scripts": {
"test": "mocha -R spec -u exports test/*-test.js"
},
"keywords": [
"soap"
],
"licenses": [
{
"type": "MIT License",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"readme": "This module lets you connect to web services using SOAP. It also provides a server that allows you to run your own SOAP services.\n\nFeatures:\n\n* Very simple API\n* Handles both RPC and Document schema types\n* Supports multiRef SOAP messages (thanks to [@kaven276](https://github.com/kaven276))\n* Support for both synchronous and asynchronous method handlers\n* WS-Security (currently only UsernameToken and PasswordText encoding is supported)\n* Slightly improved ability to handle SAP SOAP WSDLS\n 1. Sequences nest a collection of <item> objects beneath the parent object, instead of a collection of parent objects\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n```\n npm install soap\n```\n## Module\n\n### soap.createClient(url, callback) - create a new SOAP client from a WSDL url. Also supports a local filesystem path.\n\n``` javascript\n var soap = require('soap');\n var url = 'http://example.com/wsdl?wsdl';\n var args = {name: 'value'};\n soap.createClient(url, function(err, client) {\n client.MyFunction(args, function(err, result) {\n console.log(result);\n });\n });\n```\n\n### soap.listen(*server*, *path*, *services*, *wsdl*) - create a new SOAP server that listens on *path* and provides *services*.\n*wsdl* is an xml string that defines the service.\n\n``` javascript\n var myService = {\n MyService: {\n MyPort: {\n MyFunction: function(args) {\n return {\n name: args.name\n };\n }\n\n // This is how to define an asynchronous function. \n MyAsyncFunction: function(args, callback) {\n // do some work\n callback({\n name: args.name\n })\n }\n }\n }\n }\n\n var xml = require('fs').readFileSync('myservice.wsdl', 'utf8'),\n server = http.createServer(function(request,response) {\n response.end(\"404: Not Found: \"+request.url)\n });\n\n server.listen(8000);\n soap.listen(server, '/wsdl', myService, xml);\n```\n\n### server logging\n\nIf the log method is defined it will be called with 'received' and 'replied'\nalong with data.\n\n``` javascript\n server = soap.listen(...)\n server.log = function(type, data) {\n // type is 'received' or 'replied'\n };\n```\n\n### server security example using PasswordDigest\n\nIf server.authenticate is not defined no authentation will take place.\n\n``` javascript\n server = soap.listen(...)\n server.authenticate = function(security) {\n var created, nonce, password, user, token;\n token = security.UsernameToken, user = token.Username,\n password = token.Password, nonce = token.Nonce, created = token.Created;\n return user === 'user' && password === soap.passwordDigest(nonce, created, 'password');\n };\n```\n\n### server connection authorization\n\nThis is called prior to soap service method\nIf the method is defined and returns false the incoming connection is\nterminated.\n\n``` javascript\n server = soap.listen(...)\n server.authorizeConnection = function(req) {\n return true; // or false\n };\n```\n\n\n## Client\n\nAn instance of Client is passed to the soap.createClient callback. It is used to execute methods on the soap service.\n\n### Client.describe() - description of services, ports and methods as a JavaScript object\n\n``` javascript\n client.describe() // returns\n {\n MyService: {\n MyPort: {\n MyFunction: {\n input: {\n name: 'string'\n }\n }\n }\n }\n }\n```\n\n### Client.setSecurity(security) - use the specified security protocol (see WSSecurity below)\n\n``` javascript\n client.setSecurity(new WSSecurity('username', 'password'))\n```\n\n### Client.*method*(args, callback) - call *method* on the SOAP service.\n\n``` javascript\n client.MyFunction({name: 'value'}, function(err, result) {\n // result is a javascript object\n })\n```\n### Client.*service*.*port*.*method*(args, callback) - call a *method* using a specific *service* and *port*\n\n``` javascript\n client.MyService.MyPort.MyFunction({name: 'value'}, function(err, result) {\n // result is a javascript object\n })\n```\n### Client.*addSoapHeader*(soapHeader[, name, namespace, xmlns]) - add soapHeader to soap:Header node\n#### Options\n\n - `soapHeader` Object({rootName: {name: \"value\"}}) or strict xml-string\n\n##### Optional parameters when first arg is object :\n - `name` Unknown parameter (it could just a empty string)\n - `namespace` prefix of xml namespace\n - `xmlns` URI\n\n### Client.*lastRequest* - the property that contains last full soap request for client logging\n\n## WSSecurity\n\nWSSecurity implements WS-Security. UsernameToken and PasswordText/PasswordDigest is supported. An instance of WSSecurity is passed to Client.setSecurity.\n\n``` javascript\n new WSSecurity(username, password, passwordType)\n //'PasswordDigest' or 'PasswordText' default is PasswordText\n```\n",
"readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/milewise/node-soap/issues"
},
"_id": "soap@0.3.0",
"dist": {
"shasum": "1cb44bad31fe51e218e54c78aaa4446c3a311e21"
},
"_resolved": "git://github.com/btallman/node-soap#ac6240218470ef142ffed64c6e1b70ed30835c26",
"_from": "soap@git://github.com/btallman/node-soap#alpha-1"
}