cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r821146 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Date Fri, 02 Oct 2009 19:54:19 GMT
Author: dkulp
Date: Fri Oct  2 19:54:19 2009
New Revision: 821146

URL: http://svn.apache.org/viewvc?rev=821146&view=rev
Log:
Merged revisions 821046 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r821046 | dkulp | 2009-10-02 11:08:28 -0400 (Fri, 02 Oct 2009) | 1 line
  
  [CXF-2453] If datasource isn't "xml", don't do the xml things.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java?rev=821146&r1=821145&r2=821146&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Fri Oct  2 19:54:19 2009
@@ -43,7 +43,9 @@
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
 import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.SAAJOutEndingInterceptor;
+import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.message.MessageImpl;
@@ -117,6 +119,25 @@
                     }
                     
                 });
+            } else if (!ct.toLowerCase().contains("xml")) {
+                //not XML based, need to stream out directly.  This is a bit tricky as
+                //we don't want the stax stuff triggering and such
+                OutputStream out = message.getContent(OutputStream.class);
+                message.put(Message.CONTENT_TYPE, ct);
+                try {
+                    InputStream in = ds.getInputStream();
+                    IOUtils.copy(in, out);
+                    in.close();
+                    out.flush();
+                    out.close();
+                } catch (IOException e) {
+                    throw new Fault(e);
+                }
+                list.remove(0);
+                out = new CachedOutputStream();
+                message.setContent(OutputStream.class, out);
+                XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(out);
+                message.setContent(XMLStreamWriter.class, writer);
             }
         }
         



Mime
View raw message