milewise/node-soap — pull request #37 by mkiki (2012-04-14 16:51:58+00:00)
Title: Ability to change the way the SOAPAction header is computed

Hi, I've been using node-soap, thanks for the module, it is very to use.

However, I had an issue due to the way the WebService I use handles the SOAPAction header. Basically, it requires a header of the form "namespace#name", using a # symbol instead of a /.

First, I used the following workaround:

client.setSecurity({
addHeaders: function(headers) {
headers.SOAPAction = "My SOAPAction goes here";
},
toXML: function() {
return "";
}
});

but I did not think it was a good solution. So I modified the node-soap call to give the ability to change the way the SOAPAction is computed. Basically, and I can now use the following code, computing the SOAPAction header automatically once and for all.

client.setSOAPAction(function(ns, name) {
return ns.substring(4) + '#' + name;
});

Here is a pull request for the corresponding change.

Regards,

-Alex