I am trying to create an xml file like below in .NET. Actually I couldnt do <soap:Header> part. Just needed that part:
<soap:Header>
<AuthenticationSoapHeader
xmlns="http://example.service.com/WS">
<WSUserName>WSusername</WSUserName>
</AuthenticationSoapHeader>
</soap:Header>
I can do like below, I need something like above
<Header> <AuthenticationSoapHeader
xmlns="http://example.service.com/WS">
<WSUserName>WSusername</WSUserName>
</AuthenticationSoapHeader> </Header>
Thanks in advance,
doc = new XmlDocument();
XmlNode header = doc.CreateNode(XmlNodeType.Element,”soap”,”Header”,””);
The XML you are trying to create is poorly formed. The soap namespace prefix has not been declared.
I would be surprised if you can find any DOM library that will allow you to create it.