Hi everyone.
I have a problem developing code with xml and c#. I am trying to create the following Xml code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.eurosur.gmv.com/">
<soapenv:Header/>
<soapenv:Body>
xxxxxxxxxxxxxxx
</soapenv:Body>
I am trying to create it, with the following code
String sXml = @"<?xml version='1.0' encoding='utf-8'?> " +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ws=\"http://ws.dfdf.com/\"/>";
oXmlDocument.LoadXml(sXml);
XmlNamespaceManager omanager = new XmlNamespaceManager(oXmlDocument.NameTable);
omanager.AddNamespace("env", "http://schemas.xmlsoap.org/soap/envelope/");
omanager.AddNamespace("ns2", "http://ws.dfdf.com/");
omanager.AddNamespace("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
omanager.AddNamespace("ws", "http://ws.eurosur.gmv.com/");
XMLUtils oXMLUtils = new XMLUtils(oXmlDocument);
XmlNode oXmlBody = oXMLUtils.createNodeElement("soapenv:Body", "");
oXMLUtils.insertAfter(oXmlDocument.SelectSingleNode("soapenv:Envelope", omanager), oXmlBody, null);
XmlNode oXmlCreate = oXMLUtils.createNodeElement("ws:updateArtefact", "");
oXMLUtils.insertAfter(oXmlDocument.SelectSingleNode("soapenv:Envelope/Body", omanager), oXmlCreate, null);
XmlNode oXmlHeader = oXMLUtils.createNodeElement("soapenv:Header", "");
oXMLUtils.insertAfter(oXmlDocument.SelectSingleNode("soapenv:Envelope", omanager), oXmlHeader, null);
return oXmlDocument;
But when I view the result, the prefix of the tags doesn´t appear.
But in the properties of the xmlnode it is assigned.
Can someone tell me what I am doing wrong??
Thank you very much