axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Zhou <fcho...@yahoo.com>
Subject Help! AXIS 1.4 SoapEnvelope deserialization error
Date Fri, 18 Jan 2008 06:28:31 GMT
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message