cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r705695 - in /cxf/branches/2.0.x-fixes: parent/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/
Date Fri, 17 Oct 2008 18:26:23 GMT
Author: dkulp
Date: Fri Oct 17 11:26:23 2008
New Revision: 705695

URL: http://svn.apache.org/viewvc?rev=705695&view=rev
Log:
Fixes to get tests passing with latest saaj jar

Modified:
    cxf/branches/2.0.x-fixes/parent/pom.xml
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java

Modified: cxf/branches/2.0.x-fixes/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/parent/pom.xml?rev=705695&r1=705694&r2=705695&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/parent/pom.xml (original)
+++ cxf/branches/2.0.x-fixes/parent/pom.xml Fri Oct 17 11:26:23 2008
@@ -49,7 +49,7 @@
         <jaxws.version>2.0</jaxws.version>
         <jetty.version>6.1.9</jetty.version>
         <saaj.version>1.3</saaj.version>
-        <saaj.impl.version>1.3</saaj.impl.version>
+        <saaj.impl.version>1.3.2</saaj.impl.version>
         <spring.version>2.0.8</spring.version>
         <spring.mock>spring-mock</spring.mock>
         <wsdl4j.version>1.6.2</wsdl4j.version>

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java?rev=705695&r1=705694&r2=705695&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
Fri Oct 17 11:26:23 2008
@@ -61,6 +61,7 @@
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
+import org.apache.cxf.interceptor.AttachmentInInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.StaxInInterceptor;
 import org.apache.cxf.io.CachedOutputStream;
@@ -166,6 +167,7 @@
                     //LogicalHandler for DataSource payload
                     message.setContent(DataSource.class, obj);  
                 } else {                 
+                    new AttachmentInInterceptor().handleMessage(message);
                     new StaxInInterceptor().handleMessage(message);
                     
                     DataReader<XMLStreamReader> dataReader = new XMLStreamDataReader();

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java?rev=705695&r1=705694&r2=705695&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutDatabindingInterceptor.java
Fri Oct 17 11:26:23 2008
@@ -64,6 +64,7 @@
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
+import org.apache.cxf.interceptor.AttachmentOutInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxws.handler.logical.DispatchLogicalHandlerInterceptor;
 import org.apache.cxf.message.Attachment;
@@ -232,7 +233,6 @@
         }
         
         public void handleMessage(Message message) throws Fault {
-            OutputStream os = message.getContent(OutputStream.class);
             
             XMLStreamWriter xmlWriter = message.getContent(XMLStreamWriter.class);
             SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
@@ -264,15 +264,28 @@
                             l.add(head.getValue());
                         }
                     }
+                    OutputStream os = message.getContent(OutputStream.class);
                     soapMessage.writeTo(os);
+                    os.flush();
                 } else if (source != null) {
+                    if (message.getAttachments() != null
+                        && !message.getAttachments().isEmpty()) {
+                        message.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
+                        new AttachmentOutInterceptor().handleMessage(message);
+                    }
+                    OutputStream os = message.getContent(OutputStream.class);
                     doTransform(source, os);
+                    os.flush();
                 } else if (dataSource != null) {
+                    if (message.getAttachments() != null
+                        && !message.getAttachments().isEmpty()) {
+                        message.put(AttachmentOutInterceptor.WRITE_ATTACHMENTS, Boolean.TRUE);
+                        new AttachmentOutInterceptor().handleMessage(message);
+                    }
+                    OutputStream os = message.getContent(OutputStream.class);
                     doTransform(dataSource, os);
+                    os.flush();
                 }
-
-                // Finish the message processing, do flush
-                os.flush();
             } catch (Exception ex) {
                 ex.printStackTrace();
                 throw new Fault(new org.apache.cxf.common.i18n.Message("EXCEPTION_WRITING_OBJECT",
LOG, ex));
@@ -332,7 +345,6 @@
                         }
                         SOAPMessage msg = msgFactory.createMessage();
                         msg.getSOAPPart().setContent(source);
-                        msg.saveChanges();
                         if (message.getAttachments() != null) {
                             for (Attachment att : message.getAttachments()) {
                                 AttachmentPart part = msg.createAttachmentPart(att.getDataHandler());
@@ -346,6 +358,7 @@
                                 msg.addAttachmentPart(part);
                             }
                         }
+                        msg.saveChanges();
                         obj = msg;                    
                     } catch (Exception e) {
                         e.printStackTrace();



Mime
View raw message