D
david.karr
I'm using JDK 1.4.2 and WebLogic 8.1.4.
I have a situation where we create a blank SOAPMessage object, and
then parse an XML fragment and insert that fragment as the SOAP body.
This works pretty well, but there is one annoyance we see if the root
element of the fragment defines a non-default namespace, and the
elements in the fragment use that prefix.
The problem is that when the SOAPMessage object is marshalled to XML,
that single "xmlns:<prefix>" attribute is present in EVERY element in
the entire XML document. These extra attributes are redundant, as only
the attribute in the root element of the body should be required.
case, I don't expect fixes to those methods anytime soon.
At one time, I had actually written a custom method that does what
"Document.importNode()" does, and after some minor experimentation, I
realized my custom code can resolve this, but I don't have this option
in my current framework.
We're getting around this for now with a method using JDOM that
regenerates the document using "suppressNamespaces" (I'm not sure
exactly what JDOM method is being used). That sort of fixes the
problem, but any documents that actually use multiple namespaces might
break with this approach.
I have a situation where we create a blank SOAPMessage object, and
then parse an XML fragment and insert that fragment as the SOAP body.
This works pretty well, but there is one annoyance we see if the root
element of the fragment defines a non-default namespace, and the
elements in the fragment use that prefix.
The problem is that when the SOAPMessage object is marshalled to XML,
that single "xmlns:<prefix>" attribute is present in EVERY element in
the entire XML document. These extra attributes are redundant, as only
the attribute in the root element of the body should be required.
"Document.importNode()" or "SOAPMessage.writeTo()" methods. In anyFrom what I can see, it's hard to say whether the "fault" lies in the
case, I don't expect fixes to those methods anytime soon.
At one time, I had actually written a custom method that does what
"Document.importNode()" does, and after some minor experimentation, I
realized my custom code can resolve this, but I don't have this option
in my current framework.
We're getting around this for now with a method using JDOM that
regenerates the document using "suppressNamespaces" (I'm not sure
exactly what JDOM method is being used). That sort of fixes the
problem, but any documents that actually use multiple namespaces might
break with this approach.