I’m trying to create textNode passing plain text content to axiom 1.2.11. I
was able to successfully create textNode when the text doesn’t contains any
special characters(Please check attached file). However It fails when It
tries to construct  TextNode type OMTextImpl[1] object with the text with
special characters as in the attache file, It throws a runtime exception. This
runtime exception is thrown in toString(...) method of OMElementImpl class
while trying to serialize the content. AFAIU OMElementImpl class internally
uses BaseStreamWriter class which resides in the woodstox to stream the
message content, when writing the special character, the value of that
character seems not identified as valid one, So that it throws
 IOException[2] with the stackrace[3] and OMElementImpl class throws it as
runtime exception in its toString(...) method[4]. Any help to get rid of
this issue is highly appreciated.

[1].
http://svn.apache.org/viewvc/webservices/axiom/tags/1.2.11/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?view=markup#l134
[2].
https://github.com/FasterXML/woodstox/blob/master/src/main/java/com/ctc/wstx/api/InvalidCharHandler.java#L54
[3].
 at
com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:55)
  at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:623)
  at
com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:554)
  at
com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:460)
  at
org.apache.axiom.om.impl.MTOMXMLStreamWriter.writeCharacters(MTOMXMLStreamWriter.java:289)
  at
org.apache.axiom.om.impl.llom.OMTextImpl.writeOutput(OMTextImpl.java:250)
  at
org.apache.axiom.om.impl.llom.OMTextImpl.internalSerialize(OMTextImpl.java:415)
  at
org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:555)
  at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
  at
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:682)
  at
org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:555)
  at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
  at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:230)
  at
org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:125)
  at
org.apache.axiom.om.impl.llom.OMSerializableImpl.serialize(OMSerializableImpl.java:113)
  at
org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:988)
  at java.lang.String.valueOf(String.java:2849)
  at java.lang.StringBuffer.append(StringBuffer.java:232)

[4].
https://github.com/wso2-support/wso2-axiom/blob/support-1.2.11-wso2v6/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java#L983

Thanks.

-- 


*Best Regards, Vijitha Ekanayake*

Attachment: content
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to