procedure CreateBody(var pSoapEnvelope: XmlNode; var pSoapBody: XmlNode; pVersion: Option "1.1","1.2"; var reqText: Text); var lSoapDataNode: XmlNode; textString: Text; begin if pVersion = pVersion::"1.1" then XMLDOMMgt.AddElement(pSoapEnvelope, 'Body', '', SoapNS11, pSoapBody) else XMLDOMMgt.AddElement(pSoapEnvelope, 'Body', '', SoapNS12, pSoapBody); XMLDomMgt.LoadXMLNodeFromText(reqText, lSoapDataNode); XMLDOMMgt.AddElementWithPrefix(pSoapBody, 'CV3Data', '', SoapPrefix, 'SoapNamespaceTxt', pSoapBody); //xx01 XMLDOMMgt.AddElement(pSoapBody, 'data', reqText, '', lSoapDataNode); end;
Answers
I think you should use AddElementToNode() instead of AddElement() in this case.
AddElement() creates new node and you lose result of LoadXMLNodeFromText().