milewise/node-soap — pull request #185 by alexmckenley (2013-11-08 00:26:06+00:00)
Title: Add support for setting xml attributes in JSON

I implemented support for setting xml attributes within an object passed as args to a service. I could not find any way to do this currently. xml2js does this by using an attribute identifier ('$' by default). I implemented this in the ObjectToXML method of wsdl.js and thought other people might find it useful.

Example:
passing this object:
{
element1: {
$attributeName: 'true',
childElement: 'data'
}
element2: 'data'
}

Generates this XML:

data
data