cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1296466 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ systests/jaxws/ systests/jaxws/src/test/java/org/apache/cxf/systest/provider/ systests/jaxws/src/test/resources/wsdl_systest_jaxws/
Date Fri, 02 Mar 2012 21:09:40 GMT
Author: dkulp
Date: Fri Mar  2 21:09:39 2012
New Revision: 1296466

URL: http://svn.apache.org/viewvc?rev=1296466&view=rev
Log:
Merged revisions 1296462 via  svn merge from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes

........
  r1296462 | dkulp | 2012-03-02 16:07:00 -0500 (Fri, 02 Mar 2012) | 10 lines
  
  Merged revisions 1296454 via  svn merge from
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1296454 | dkulp | 2012-03-02 15:53:53 -0500 (Fri, 02 Mar 2012) | 2 lines
    
    [CXF-4130] Fix problems with Providers writing bodies into headers
    Patch from Seumas Soltysik applied
  ........
  
........

Added:
    cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/CXF4130Provider.java
      - copied unchanged from r1296462, cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/CXF4130Provider.java
    cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/CXF4130Test.java
      - copied unchanged from r1296462, cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/CXF4130Test.java
    cxf/branches/2.4.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/cxf4130data.txt
      - copied unchanged from r1296462, cxf/branches/2.5.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/cxf4130data.txt
    cxf/branches/2.4.x-fixes/systests/jaxws/src/test/resources/wsdl_systest_jaxws/cxf4130.wsdl
      - copied unchanged from r1296462, cxf/branches/2.5.x-fixes/systests/jaxws/src/test/resources/wsdl_systest_jaxws/cxf4130.wsdl
Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
    cxf/branches/2.4.x-fixes/systests/jaxws/pom.xml

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

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java?rev=1296466&r1=1296465&r2=1296466&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Fri Mar  2 21:09:39 2012
@@ -54,6 +54,7 @@ import org.apache.cxf.message.MessageImp
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.staxutils.OverlayW3CDOMStreamWriter;
 import org.apache.cxf.staxutils.StaxUtils;
@@ -187,7 +188,7 @@ public class MessageModeOutInterceptor e
         
         public void handleMessage(SoapMessage message) throws Fault {
             MessageContentsList list = (MessageContentsList)message.getContent(List.class);
-            Object o = list.get(0);
+            Object o = list.remove(0);
             SOAPMessage soapMessage = null;
             
             if (o instanceof SOAPMessage) {
@@ -221,7 +222,9 @@ public class MessageModeOutInterceptor e
             // Replace stax writer with DomStreamWriter
             message.setContent(XMLStreamWriter.class, writer);
             message.setContent(SOAPMessage.class, soapMessage);
-            
+
+            BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
+
             DocumentFragment frag = soapMessage.getSOAPPart().createDocumentFragment();
             try {
                 Node body = soapMessage.getSOAPBody();
@@ -231,7 +234,25 @@ public class MessageModeOutInterceptor e
                     frag.appendChild(nd);
                     nd = soapMessage.getSOAPBody().getFirstChild();
                 }
-                list.set(0, frag);
+                
+                int index = 0;
+
+                boolean client = isRequestor(message);
+                BindingMessageInfo bmsg = null; 
+
+                if (client) {
+                    bmsg = bop.getInput();
+                } else if (bop.getOutput() != null) {
+                    bmsg = bop.getOutput();  
+                }
+                if (bmsg != null && bmsg.getMessageParts() != null 
+                    && bmsg.getMessageParts().size() > 0) {
+                    index = bmsg.getMessageParts().get(0).getIndex(); 
+                }
+
+                list.set(index, frag);
+                
+                
                 //No need to buffer this as we're already a DOM, 
                 //but only do so if someone hasn't actually configured this
                 Object buffer = message
@@ -242,7 +263,6 @@ public class MessageModeOutInterceptor e
             } catch (Exception ex) {
                 throw new Fault(ex);
             }
-            BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
             if (bop != null && bop.isUnwrapped()) {
                 bop = bop.getWrappedOperation();
                 message.getExchange().put(BindingOperationInfo.class, bop);

Modified: cxf/branches/2.4.x-fixes/systests/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxws/pom.xml?rev=1296466&r1=1296465&r2=1296466&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxws/pom.xml (original)
+++ cxf/branches/2.4.x-fixes/systests/jaxws/pom.xml Fri Mar  2 21:09:39 2012
@@ -197,6 +197,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+          <groupId>commons-httpclient</groupId>
+          <artifactId>commons-httpclient</artifactId>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
         </dependency>



Mime
View raw message