From 36d497f58855f2d8558386fa46eaec5f02f6f956 Mon Sep 17 00:00:00 2001 From: "H. Arnold Jones" Date: Fri, 9 May 2014 05:01:44 -0400 Subject: [PATCH] Consolidate commit, intended to supersede #208 PR. --- lib/wsdl.js | 3 +++ test/client-test.js | 10 ++++++++++ test/wsdl/binding_document.wsdl | 12 ++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 test/wsdl/binding_document.wsdl diff --git a/lib/wsdl.js b/lib/wsdl.js index 3dc5ed6b6..213b0e0c7 100644 --- a/lib/wsdl.js +++ b/lib/wsdl.js @@ -730,6 +730,9 @@ var WSDL = function(definition, uri, options) { var bindings = self.definitions.bindings; for (var bindingName in bindings) { var binding = bindings[bindingName]; + if (typeof binding.style === 'undefined') { + binding.style = 'document'; + } if (binding.style !== 'document') continue; var methods = binding.methods; diff --git a/test/client-test.js b/test/client-test.js index 39ca9f482..9bb32b034 100644 --- a/test/client-test.js +++ b/test/client-test.js @@ -41,6 +41,16 @@ describe('SOAP Client', function() { }); assert(!called); }); + + it('should set binding style to "document" by default if not explicitly set in WSDL, per SOAP spec', function (done) { + soap.createClient(__dirname+'/wsdl/binding_document.wsdl', function(err, client) { + assert.ok(client); + assert.ok(!err); + + assert.ok(client.wsdl.definitions.bindings.mySoapBinding.style === 'document'); + done(); + }); + }); describe('Extra headers in request and last response', function() { var server = null; diff --git a/test/wsdl/binding_document.wsdl b/test/wsdl/binding_document.wsdl new file mode 100644 index 000000000..4ce06ef43 --- /dev/null +++ b/test/wsdl/binding_document.wsdl @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file