Hi All,
I am re-posting this message, hoping to get some
urgent help.
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
soapEnvelope object seems good to me in my debugger,
but a 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
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]