Hi All,
I am using AXIS 1.4 for my web service needs. I am now
encounting the following error when I try to send an
XML over HTTP:
I have a valid XML message as a string, the XML
message defines a namespace at the root element like
this:
xmlns:ns1="somthing"
Let me assume this xml string as xmltext, now I create
a soap envelope with this XML message as body, the
problem occurs when I try to deserialize it using
soapEnvelope.toString() or soapEnvelope.getAsString().
I notice that for every local element in the original
xml such as this:
<ns1:rec>xxx</ns1:rec>,
in the output string, I get the the following:
<ns1:rec xmlns:ns1="">xxx</ns1:rec>
That is, there is an extra attribute with empty value.
This causes problems for the receivers of the http
response.
Here are my code snappet:
===================================================
SOAPEnvelope soapEnvelope = new SOAPEnvelope();
Element bodyElement =
createDocument(xmltext).getDocumentElement();
org.apache.axis.message.SOAPBodyElement
messageElement = new
org.apache.axis.message.SOAPBodyElement(bodyElement);
soapEnvelope.addBodyElement((SOAPBodyElement)messageElement);
The createDocument(xmlText) calls the following APIs:
InputSource source = new InputSource( new
StringReader( xmlText ) ) ;
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setIgnoringElementContentWhitespace(false);
DocumentBuilder docBuilder =
factory.newDocumentBuilder();
return docBuilder.parse(source);
It seems to me that AXIS has a bug handling this case.
Any help is very much appreciated!
Thanks!
Frank
any help is very much appreciated.
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]