You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ke...@apache.org on 2007/12/04 09:57:59 UTC

svn commit: r600845 - /webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java

Author: keithc
Date: Tue Dec  4 00:57:58 2007
New Revision: 600845

URL: http://svn.apache.org/viewvc?rev=600845&view=rev
Log:
Fixing issue with serializing OMText as documentation


Modified:
    webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java

Modified: webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?rev=600845&r1=600844&r2=600845&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
+++ webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Tue Dec  4 00:57:58 2007
@@ -20,6 +20,7 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMText;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
@@ -31,6 +32,8 @@
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+import javax.xml.stream.XMLStreamException;
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -143,7 +146,19 @@
 
     public String getDocumentation() {
         if (documentation != null) {
-            return documentation.toString();
+            if (documentation.getType() == OMNode.TEXT_NODE) {
+                return ((OMText)documentation).getText();
+            } else {
+                StringWriter writer = new StringWriter();
+                documentation.build();
+                try {
+                   documentation.serialize(writer);
+                } catch (XMLStreamException e) {
+                    log.error(e);
+                }
+                writer.flush();
+                return writer.toString();
+            }
         }
         return null;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org