Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverting #914 #937

Merged
merged 1 commit into from
May 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,62 +182,6 @@ Client.prototype._defineMethod = function(method, location) {
};
};

Client.prototype._isSequenceRequired = function(methodName) {
var tns = this.wsdl.definitions.$targetNamespace;
var methodRequestName = _.result(this.wsdl.definitions, 'messages.' + methodName + '.$name');
var args = _.result(this.wsdl.definitions, 'messages.' + methodRequestName + '.parts');

if(typeof args === 'undefined' && typeof _.pick(args, 'params') !== 'undefined') {
return false;
}
if(Object.keys(args).length === 1) {
return false;
}

var complexTypeName = _.result(this.wsdl.definitions, 'messages.' + methodRequestName + '.element.$name');
var modeOfComplexType = _.result(
this.wsdl.definitions,
'schemas[\'' + tns + '\'].elements.' + complexTypeName + '.children[0].children[0].name');

if(modeOfComplexType === 'sequence') {
return true;
}

return false;
};

Client.prototype._setSequenceArgs = function(argsScheme, args) {
var result = {};
if(typeof argsScheme !== 'object') {
return args;
}
for (var partIndex in argsScheme) {
if(typeof args[partIndex] === 'undefined') {
continue;
}
if(typeof argsScheme[partIndex] !== 'object') {
result[partIndex] = args[partIndex];
} else {
result[partIndex] = this._setSequenceArgs(argsScheme[partIndex], args[partIndex]);
}
}
return result;
};

Client.prototype._getArgsScheme = function(methodName) {
var methodRequestName = _.result(this.wsdl.definitions, 'messages.'+methodName+'.$name');
var args = _.result(this.wsdl.definitions, 'messages.' + methodRequestName + '.parts');

if(typeof args === 'undefined' && typeof _.pick(args, 'params') !== 'undefined') {
return [];
}
if(Object.keys(args).length === 1) {
return [];
}

return args;
};

Client.prototype._invoke = function(method, args, location, callback, options, extraHeaders) {
var self = this,
name = method.$name,
Expand All @@ -258,13 +202,6 @@ Client.prototype._invoke = function(method, args, location, callback, options, e
},
xmlnsSoap = "xmlns:" + envelopeKey + "=\"http://schemas.xmlsoap.org/soap/envelope/\"";

if(this._isSequenceRequired(name)) {
var argsScheme = this._getArgsScheme(name);
if(argsScheme) {
args = this._setSequenceArgs(argsScheme, args);
}
}

if (this.wsdl.options.forceSoap12Headers) {
headers["Content-Type"] = "application/soap+xml; charset=utf-8";
xmlnsSoap = "xmlns:" + envelopeKey + "=\"http://www.w3.org/2003/05/soap-envelope\"";
Expand Down
2 changes: 1 addition & 1 deletion lib/wsdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2082,7 +2082,7 @@ WSDL.prototype._fromServices = function(services) {

};

WSDL.prototype._splitQName = splitQName;


WSDL.prototype._xmlnsMap = function() {
var xmlns = this.definitions.xmlns;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Copyright 2006-2015 Salesforce.com, inc. All Rights Reserved
<xsd:complexType>
<xsd:sequence>
<xsd:element name="type" type="xsd:string"/>
<xsd:element name="fullNames" type="xsd:string"/>
<xsd:element name="fullNames" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Expand Down
55 changes: 0 additions & 55 deletions test/sequence-test.js

This file was deleted.

63 changes: 0 additions & 63 deletions test/wsdl/sequnceexmple.wsdl

This file was deleted.