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

Soap 1.1 Fault fix & enabled rest of the tests in wsdl-test.js #12

Merged
merged 3 commits into from
Sep 16, 2016
Merged
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions src/parser/wsdl/binding.js
Original file line number Diff line number Diff line change
@@ -35,6 +35,18 @@ class Binding extends WSDLElement {
this.operations[child.$name] = child;
child.operation = operation;

//figure out from the binding operation soap version 1.1 or 1.2
for (let p in child.children){
if (child.children[p].$soapAction !== undefined){
if(child.children[p].nsURI === 'http://schemas.xmlsoap.org/wsdl/soap/'){
child.soapVersion ='1.1';
break;
} else if(child.children[p].nsURI === 'http://schemas.xmlsoap.org/wsdl/soap12/') {
child.soapVersion ='1.2';
break;
}
}
}
// Set portType.operation.input.message to binding.operation.input
if (operation.input && child.input) {
child.input.message = operation.input.message;
@@ -54,6 +66,7 @@ class Binding extends WSDLElement {
// For RPC style
child.parameterOrder = operation.$parameterOrder.split(/\s+/);
}
child.soapVersion = operation
child.style = child.style || style;
child.postProcess(definitions);
}
8 changes: 8 additions & 0 deletions src/parser/wsdl/operation.js
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ class Operation extends WSDLElement {
//there can be multiple faults defined in the operation. They all will have same type name 'fault'
//what differentiates them from each other is, the element/s which will get added under fault <detail> during runtime.
this.faults = [];
this.soapVersion;
}

addChild(child) {
@@ -261,6 +262,13 @@ class Operation extends WSDLElement {
*/
if (isOutput && parameterDescriptor && parameterDescriptor.body.Fault) {
let xsdStr = new QName(helper.namespaces.xsd, 'string', 'xsd');
var form;
if (this.soapVersion === '1.1') {
form == 'unqualified';
} else if (this.soapVersion === '1.2') {
form == 'qualified';
}

let faultDescriptor = new ElementDescriptor(
new QName(nsURI, 'Fault', prefix), null, 'qualified', false);
bodyDescriptor.add(faultDescriptor);