soap on node is parsing json to xml wrong
To deal with the namespace, pass the ignoredNamespaces the soap.createClient
options.
{ "ignoredNamespaces": { namespaces: ['ns'] },}
And then add the namespace manually. It's ugly, but it works.
To deal with multiple UserDefinedFields
, it should look like this:
{ . . . DomainRegistration['ns:UserDefinedFields']['ns:UserDefinedField'][0] : { "base:displayName": "Campaign?", "base:fieldValue": "Yes" }, DomainRegistration['ns:UserDefinedFields']['ns:UserDefinedField'][1] : { "base:displayName": "Anticipated Use", "base:fieldValue": 6 } . . .}
Or to put it more simply:
{ ouside: { insideA: [ 'one', 'two', ] insideB: [ {'one':'ONE'}, {'two':'TWO'} ] }}//will create:<outside> <insideA> <one /> <two /> </insideA> <insideB> <one>ONE</one> </insideB> <insideB> <two>TWO</two> </insideB></outside>