From 02ea8c2a83ccf2d513a8889f50fd6fd5f746d690 Mon Sep 17 00:00:00 2001 From: Michael Szlapa Date: Wed, 11 Nov 2015 14:21:10 -0500 Subject: [PATCH] Remove SOAPAction http header in SOAP 1.2, extra header was causing some servers to trip --- lib/client.js | 4 +++- test/client-test.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/client.js b/lib/client.js index 07d43f447..5856fd5cc 100644 --- a/lib/client.js +++ b/lib/client.js @@ -179,7 +179,9 @@ Client.prototype._invoke = function(method, args, location, callback, options, e soapAction = ((ns.lastIndexOf("/") !== ns.length - 1) ? ns + "/" : ns) + name; } - headers.SOAPAction = '"' + soapAction + '"'; + if (!this.wsdl.options.forceSoap12Headers) { + headers.SOAPAction = '"' + soapAction + '"'; + } options = options || {}; diff --git a/test/client-test.js b/test/client-test.js index 37c9894e5..bf54df31c 100644 --- a/test/client-test.js +++ b/test/client-test.js @@ -222,7 +222,7 @@ describe('SOAP Client', function() { assert.ok(client.lastRequest); assert.equal(client.lastRequestHeaders['Content-Type'], 'application/soap+xml; charset=utf-8'); assert.notEqual(client.lastRequest.indexOf('xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\"'), -1); - + assert( !client.lastRequestHeaders.SOAPAction ); done(); }, null, {'test-header': 'test'}); }, baseUrl);