axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r680152 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java
Date Sun, 27 Jul 2008 17:18:51 GMT
Author: scheu
Date: Sun Jul 27 10:18:50 2008
New Revision: 680152

URL: http://svn.apache.org/viewvc?rev=680152&view=rev
Log:
Use marshal to outputstream even if attachments are marshalled.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java?rev=680152&r1=680151&r2=680152&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/datasource/jaxb/JAXBDSContext.java
Sun Jul 27 10:18:50 2008
@@ -26,6 +26,7 @@
 import org.apache.axis2.jaxws.message.databinding.JAXBUtils;
 import org.apache.axis2.jaxws.message.util.XMLStreamWriterWithOS;
 import org.apache.axis2.jaxws.spi.Constants;
+import org.apache.axis2.jaxws.utility.JavaUtils;
 import org.apache.axis2.jaxws.utility.XMLRootElementUtil;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -338,7 +339,8 @@
                 marshalByElement(obj, 
                                  m, 
                                  writer, 
-                                 !am.isXOPPackage());
+                                 true);
+                                 //!am.isXOPPackage());
             } else {
                 marshalByType(obj,
                               m,
@@ -370,6 +372,10 @@
                 // XMLStreamWriter. 
                 // Take advantage of this optimization if there is an output stream.
                 try {
+                    if (!optimize) {
+                        log.debug(JavaUtils.stackToString());
+                        getOutputStream(writer);
+                    }
                     OutputStream os = (optimize) ? getOutputStream(writer) : null;
                     if (os != null) {
                         if (DEBUG_ENABLED) {
@@ -409,13 +415,23 @@
      * @return OutputStream or null
      */
     private static OutputStream getOutputStream(XMLStreamWriter writer) throws XMLStreamException
{
+        if (log.isDebugEnabled()) {
+            log.debug("XMLStreamWriter is " + writer);
+        }
+        OutputStream os = null;
         if (writer.getClass() == MTOMXMLStreamWriter.class) {
-            return ((MTOMXMLStreamWriter) writer).getOutputStream();
+            os = ((MTOMXMLStreamWriter) writer).getOutputStream();
+            if (log.isDebugEnabled()) {
+                log.debug("OutputStream accessible from MTOMXMLStreamWriter is " + os);
+            }
         }
         if (writer.getClass() == XMLStreamWriterWithOS.class) {
-            return ((XMLStreamWriterWithOS) writer).getOutputStream();
+            os = ((XMLStreamWriterWithOS) writer).getOutputStream();
+            if (log.isDebugEnabled()) {
+                log.debug("OutputStream accessible from XMLStreamWriterWithOS is " + os);
+            }
         }
-        return null;
+        return os;
     }
     
     /**



Mime
View raw message