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

soap

Package Overview
Dependencies
Maintainers
4
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

soap - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

0

CONTRIBUTING.md

@@ -0,0 +0,0 @@ #Contribution Guidelines

59

History.md

@@ -0,1 +1,12 @@

0.9.2 / 2015-09-08
=================
* [ENHANCEMENT] Add support for xsd element ref. (#700)
* [MAINTENANCE] Moving travis build to containers.
* [MAINTENANCE] Add request sample for an operation without any parameters. (#703)
* [DOC] update spelling and formatting to clarify several sections of Readme. (#708)
* [ENHANCEMENT] Add the correct namespace alias for operations without parameters by simply removing the special case where input.parts is empty. If special logic is wanted for this case, it should be contained in objectToRpcXML in any case. (#703)
* [FIX] Fix a typo in WSDL#findChildParameterObject. (#686)
* [FIX] Fixed SOAP Fault errors not being raised as errors. (#676)
* [FIX] Use diffrent namespace styles for soap fault 1.1 and 1.2. (#674)
0.9.1 / 2015-05-30

@@ -103,35 +114,35 @@ =================

=================
* Enhancement: Adding bearer security type Exporting security type for usage.
* Enhancement: The qualified elementFormQualified must be respected only when the current element is not a global element. The namespace attribute is only needed if it's not included in the xmlns.
* Fix: Remove automatic port appending to "Host" header.
* Fix: Avoid creating soap:Header container when there are no children.
* Fix: Allowing a 'null' argument for WSDL methods that take no arguments.
* Fix: Wrong initialization of xmlns array when handling rpc stype wsdl.
* Fix: Fault handling. err should be used less frequently now.
* Fix: Added checking if there is input and output for operations under bindings section.
* Fix: XSD conflict with same namespace.
* [ENHANCEMENT] Adding bearer security type Exporting security type for usage.
* [ENHANCEMENT] The qualified elementFormQualified must be respected only when the current element is not a global element. The namespace attribute is only needed if it's not included in the xmlns.
* [FIX] Remove automatic port appending to "Host" header.
* [FIX] Avoid creating soap:Header container when there are no children.
* [FIX] Allowing a 'null' argument for WSDL methods that take no arguments.
* [FIX] Wrong initialization of xmlns array when handling rpc stype wsdl.
* [FIX] Fault handling. err should be used less frequently now.
* [FIX] Added checking if there is input and output for operations under bindings section.
* [FIX] XSD conflict with same namespace.
0.5.1 / 2014-07-11
=================
* Enhancement: Add "defaults" parameter to BasicAuthSecurity's constructor
* Enhancement: Added possibility to set a custom `valueKey` for the parsed values from XML SOAP Response
* Fix: don't append port 80 to Host if not needed
* Fix: Remove possible existing BOM characters from XML String before passing it to `WSDL#_fromXML()` and parsing it.
* Fix: Handling nil attributes in response xml
* [ENHANCEMENT] Add "defaults" parameter to BasicAuthSecurity's constructor
* [ENHANCEMENT] Added possibility to set a custom `valueKey` for the parsed values from XML SOAP Response
* [FIX] don't append port 80 to Host if not needed
* [FIX] Remove possible existing BOM characters from XML String before passing it to `WSDL#_fromXML()` and parsing it.
* [FIX] Handling nil attributes in response xml
0.5.0 / 2014-07-11
=================
* Enhancement: Allowing namespace prefixes to be ignored via config.
* Enhancement: wsdl should handle more types
* Fix: Handle defined messages ending with "Response", "Out", or "Output"
* Fix: Adding default attributesKey to server and allowing the property to be configurable fixing issue #406
* Fix: Remove extra characters before and after soap envelope
* Fix: Allow operations to not have definitions
* Fix: Ignore unknown elements
* Fix: Keep ns from top-level
* Fix: Check status code of invocation response
* [ENHANCEMENT] Allowing namespace prefixes to be ignored via config.
* [ENHANCEMENT] wsdl should handle more types
* [FIX] Handle defined messages ending with "Response", "Out", or "Output"
* [FIX] Adding default attributesKey to server and allowing the property to be configurable fixing issue #406
* [FIX] Remove extra characters before and after soap envelope
* [FIX] Allow operations to not have definitions
* [FIX] Ignore unknown elements
* [FIX] Keep ns from top-level
* [FIX] Check status code of invocation response
0.4.7 / 2014-06-16
=================
* Allow request elements to have both content and attributes.
* [ENHANCEMENT] Allow request elements to have both content and attributes.

@@ -138,0 +149,0 @@ 0.4.6 / 2014-06-16

"use strict";
module.exports = require('./lib/soap');

@@ -19,3 +19,4 @@ /*

debug = require('debug')('node-soap'),
url = require('url');
url = require('url'),
_ = require('lodash');

@@ -177,3 +178,3 @@ var Client = function(wsdl, endpoint, options) {

if (input.parts) {
if (input.parts || args === null) {
assert.ok(!style || style === 'rpc', 'invalid message definition for document style binding');

@@ -184,4 +185,2 @@ message = self.wsdl.objectToRpcXML(name, args, alias, ns);

message = args;
} else if (args === null) {
message = "<" + name + " />";
} else {

@@ -221,2 +220,11 @@ assert.ok(!style || style === 'document', 'invalid message definition for rpc style binding');

var tryJSONparse = function(body) {
try {
return JSON.parse(body);
}
catch(err) {
return undefined;
}
};
req = self.httpClient.request(location, xml, function(err, response, body) {

@@ -232,10 +240,15 @@ var result;

} else {
try {
obj = self.wsdl.xmlToObject(body);
} catch (error) {
//When the output element cannot be looked up in the wsdl,
//Then instead of sending the error, We pass the body in the response.
// When the output element cannot be looked up in the wsdl and the body is JSON
// instead of sending the error, we pass the body in the response.
if(!output.$lookupTypes) {
debug('Response element is not present. Unable to convert response xml to json.');
return callback(null,response,body);
// If the response is JSON then return it as-is.
var json = _.isObject(body) ? body : tryJSONparse(body);
if (json) {
return callback(null, response, json);
}
}

@@ -242,0 +255,0 @@ error.response = response;

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ 'use strict';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -33,3 +33,3 @@ /*

compress = require("compress");
} catch (e) {
} catch (error) {
}

@@ -241,11 +241,8 @@

}
catch (e) {
if (e.Fault !== undefined) {
// 3rd param is the NS prepended to all elements
// It must match the NS defined in the Envelope (set by the _envelope method)
var fault = self.wsdl.objectToDocumentXML("Fault", e.Fault, "soap");
callback(self._envelope(fault, includeTimestamp));
catch (error) {
if (error.Fault !== undefined) {
return self._sendError(error.Fault, callback, includeTimestamp);
}
else
throw e;
throw error;
}

@@ -268,3 +265,3 @@ };

method = this.services[serviceName][portName][methodName];
} catch (e) {
} catch (error) {
return callback(this._envelope('', includeTimestamp));

@@ -279,4 +276,3 @@ }

if (error && error.Fault !== undefined) {
var fault = self.wsdl.objectToDocumentXML("Fault", error.Fault, "soap");
return callback(self._envelope(fault, includeTimestamp));
return self._sendError(error.Fault, callback, includeTimestamp);
}

@@ -341,2 +337,22 @@ else if (result === undefined) {

Server.prototype._sendError = function(soapFault, callback, includeTimestamp) {
var self = this,
fault;
if (soapFault.faultcode) {
// Soap 1.1 error style
// Root element will be prependend with the soap NS
// It must match the NS defined in the Envelope (set by the _envelope method)
fault = self.wsdl.objectToDocumentXML("soap:Fault", soapFault, undefined);
}
else {
// Soap 1.2 error style.
// 3rd param is the NS prepended to all elements
// It must match the NS defined in the Envelope (set by the _envelope method)
fault = self.wsdl.objectToDocumentXML("Fault", soapFault, "soap");
}
return callback(self._envelope(fault, includeTimestamp));
};
exports.Server = Server;

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@

@@ -20,2 +20,3 @@ /*

var _ = require('lodash');
var selectn = require('selectn');

@@ -1397,3 +1398,6 @@ var Primitives = {

if (body.Fault) {
var error = new Error(body.Fault.faultcode + ': ' + body.Fault.faultstring + (body.Fault.detail ? ': ' + body.Fault.detail : ''));
var code = selectn('faultcode.$value', body.Fault);
var string = selectn('faultstring.$value', body.Fault);
var detail = selectn('detail.$value', body.Fault);
var error = new Error(code + ': ' + string + (detail ? ': ' + detail : ''));
error.root = root;

@@ -1543,3 +1547,5 @@ throw error;

//find sub namespace if not a primitive
if (childParameterTypeObject && childParameterTypeObject.$type && (childParameterTypeObject.$type.indexOf('xsd') === -1)) {
if (childParameterTypeObject &&
((childParameterTypeObject.$type && (childParameterTypeObject.$type.indexOf('xsd') === -1)) ||
childParameterTypeObject.$ref)) {
if(childParameterTypeObject.$baseNameSpace) { //this element has a base with another namespace (the correct one)

@@ -1549,3 +1555,3 @@ ns = childParameterTypeObject.$baseNameSpace + ':';

var childParameterType = childParameterTypeObject.$type;
var childParameterType = childParameterTypeObject.$type || childParameterTypeObject.$ref;

@@ -1566,4 +1572,19 @@ var childNamespace = '';

}
var completeChildParameterTypeObject = self.findChildParameterObjectFromSchema(childName, childXmlns) || childParameterTypeObject;
// There is matching element ref
if (childParameterTypeObject.$ref) {
ns = childNamespace ? childNamespace + ':' : '';
xmlnsAttrib = childXmlnsAttrib;
}
var completeChildParameterTypeObject;
if (childParameterTypeObject.$type) {
completeChildParameterTypeObject =
self.findChildParameterObjectFromSchema(childName, childXmlns) ||
childParameterTypeObject;
} else {
completeChildParameterTypeObject =
self.findParameterObject(childXmlns, childName) ||
childParameterTypeObject;
}
for(var ignoredNamespacesIndex = 0, ignoredNamespacesLength = this.ignoredNamespaces.length; ignoredNamespacesIndex < ignoredNamespacesLength; ignoredNamespacesIndex++) {

@@ -1675,5 +1696,6 @@ if(this.ignoredNamespaces[ignoredNamespacesIndex] === childNamespace) {

i = 0,
child;
child,
ref;
if(parameterTypeObj.$lookupTypes && Array.isArray(parameterTypeObj.$lookupTypes && parameterTypeObj.$lookupTypes.length)) {
if(parameterTypeObj.$lookupTypes && Array.isArray(parameterTypeObj.$lookupTypes) && parameterTypeObj.$lookupTypes.length) {
var types = parameterTypeObj.$lookupTypes;

@@ -1688,2 +1710,9 @@

}
if(typeObj.$ref) {
ref = splitNSName(typeObj.$ref);
if (ref.name === childName) {
found = typeObj;
break;
}
}
}

@@ -1695,2 +1724,8 @@ } else {

}
if (object.$ref) {
ref = splitNSName(object.$ref);
if (ref.name === childName) {
return object;
}
}

@@ -1697,0 +1732,0 @@ if (object.children) {

{
"name": "soap",
"version": "0.9.1",
"version": "0.9.2",
"description": "A minimal node SOAP client",

@@ -10,7 +10,8 @@ "engines": {

"dependencies": {
"debug": "~0.7.4",
"lodash": "~2.4.1",
"request": ">=2.9.0",
"sax": ">=0.6",
"strip-bom": "~0.3.1",
"debug": "~0.7.4"
"selectn": "^0.9.6",
"strip-bom": "~0.3.1"
},

@@ -17,0 +18,0 @@ "repository": {

@@ -0,0 +0,0 @@ Publishing

@@ -84,5 +84,5 @@ # Soap [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url]

### server logging
### Server Logging
If the log method is defined it will be called with 'received' and 'replied'
If the `log` method is defined it will be called with 'received' and 'replied'
along with data.

@@ -157,5 +157,5 @@

### server security example using PasswordDigest
### Server security example using PasswordDigest
If server.authenticate is not defined no authentation will take place.
If `server.authenticate` is not defined then no authentication will take place.

@@ -172,6 +172,6 @@ ``` javascript

### server connection authorization
### Server connection authorization
This is called prior to soap service method
If the method is defined and returns false the incoming connection is
The `server.authorizeConnection` method is called prior to the soap service method.
If the method is defined and returns `false` then the incoming connection is
terminated.

@@ -189,3 +189,3 @@

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

@@ -212,4 +212,4 @@ ### Client.describe() - description of services, ports and methods as a JavaScript object

as well. The interface is quite simple. Each protocol defines 2 methods:
* addOptions - a method that accepts an options arg that is eventually passed directly to `request`
* toXML - a method that reurns a string of XML.
* `addOptions` - a method that accepts an options arg that is eventually passed directly to `request`
* `toXML` - a method that returns a string of XML.

@@ -227,5 +227,5 @@ By default there are 3 protocols:

as default request options to the constructor:
* rejectUnauthorized: false
* strictSSL: false
* secureOptions: constants.SSL_OP_NO_TLSv1_2//this is likely needed for node >= 10.0
* `rejectUnauthorized: false`
* `strictSSL: false`
* `secureOptions: constants.SSL_OP_NO_TLSv1_2` (this is likely needed for node >= 10.0)

@@ -232,0 +232,0 @@ ``` javascript

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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