Thank you for answering. Currently I'm reading in a template xml file and using createDefaultMap(). Then I'm modifying element text with PrivateData values. It works as expected and achieved the desired end result.
evalToNode - the element to modify
createElement - to create new element for the current element requiring modification
createText - applying PrivateData values
appendChild - to append the previous created text to new element
replaceChild - to replace current with new.
Now I want to try and write from scratch. I'm attempting to fully replicate what is currently proven and used to successfully post requests.
I am trying to add additional namespaces to match the first I applied, xmlns:soap e.g. xmp="XMPieWSAPI"
should be xmlns:xmp="XMPieWSAPI". Right now I cannot achieve this.
SCRIPT
function jobArrived( s : Switch, job : Job ){
var xmlPath = "C:\\\\...\\Campaign_GetID.xml"
var xmlDoc = new Document();
var xmlMap = xmlDoc.createEmptyMap();
xmlMap.put("soap", "
http://schemas.xmlsoap.org/soap/envelope/");
var xmlRoot = xmlDoc.createElement("soap:Envelope",xmlMap);
xmlDoc.setDocumentElement(xmlRoot);
/*
xmlRoot.addAttribute('xsi', xmlMap, "
http://www.w3.org/2001/XMLSchema-instance");
xmlRoot.addAttribute("xsd", xmlMap, "
http://www.w3.org/2001/XMLSchema");
xmlRoot.addAttribute("xmp", xmlMap, "XMPieWSAPI");
var soapBody = xmlDoc.createElement("soap:Body",xmlMap);
xmlRoot.appendChild(soapBody);
var xmpRootElement = xmlDoc.createElement("xmp:GetID",xmlMap);
xmlRoot.appendChild(xmpRootElement);
*/
xmlDoc.save(xmlPath)
}
OUTPUT
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/" xsi="
http://www.w3.org/2001/XMLSchema-instance" xsd="
http://www.w3.org/2001/XMLSchema" xmp="XMPieWSAPI">
<soap:Body/>
</soap:Envelope>