[prev in list] [next in list] [prev in thread] [next in thread]
List: axis-user
Subject: Message Element initialization
From: Hassan Khan <hassankhan986 () gmail ! com>
Date: 2018-01-12 16:45:01
Message-ID: CAOpoXhHtp=v2yeutOe+12Fk7Ddc-W+R_pXOyjFBbya_O_XCeDQ () mail ! gmail ! com
[Download RAW message or body]
Hi,
I was reading a xml file that has the body of my soap message as below, but
look like the initialization to messageElement put a "xmlns:rim="" on all
values. Is there a way to specify the namespace so it does not put that ?
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
FileInputStream fstreamRequest = new FileInputStream(new
File("C:\\test\\request.xml"));
// Read XML File
String xml = IOUtils.toString(new FileInputStream(new
File("C:\\test\\request.xml")), "UTF-8");
InputSource is = new InputSource(new StringReader(xml));
// Parse XML String to DOM
factory.setNamespaceAware(true);
factory.setIgnoringComments(true);
XMLDoc = builder.parse(is);
//XMLDoc =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new
File("C:\\test\\request.xml"));
org.w3c.dom.Element element = XMLDoc.getDocumentElement();
m[0] = new MessageElement(element);
Thanks
--
Hassan Khan
[Attachment #3 (text/html)]
<div dir="ltr"><div><div>Hi,<br><br></div>I was reading a xml file that has the body \
of my soap message as below, but look like the initialization to messageElement put a \
"xmlns:rim="" on all values. Is there a way to specify the namespace \
so it does not put that ?<br><br> DocumentBuilderFactory factory = \
DocumentBuilderFactory.newInstance();<br> DocumentBuilder builder \
= factory.newDocumentBuilder();<br> FileInputStream \
fstreamRequest = new FileInputStream(new \
File("C:\\test\\request.xml"));<br> // Read XML File<br> \
String xml = IOUtils.toString(new FileInputStream(new \
File("C:\\test\\request.xml")), "UTF-8");<br> \
InputSource is = new InputSource(new StringReader(xml));<br> // Parse \
XML String to DOM<br> factory.setNamespaceAware(true);<br> \
factory.setIgnoringComments(true);<br> XMLDoc = builder.parse(is);<br> \
<br> //XMLDoc = \
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new \
File("C:\\test\\request.xml"));<br> org.w3c.dom.Element \
element = XMLDoc.getDocumentElement();<br> <br> \
<span style="background-color:rgb(255,255,0)"> m[0] = new \
MessageElement(element);</span><br><br><br></div>Thanks<br \
clear="all"><div><div><div><br>-- <br><div class="gmail_signature">Hassan Khan</div> \
</div></div></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic