You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2007/11/27 03:58:35 UTC

svn commit: r598499 - in /incubator/cxf/branches/2.0.x-fixes: ./ distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/...

Author: ningjiang
Date: Mon Nov 26 18:58:34 2007
New Revision: 598499

URL: http://svn.apache.org/viewvc?rev=598499&view=rev
Log:
Merged revisions 598358-598464 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r598358 | ajaypaibir | 2007-11-27 01:45:15 +0800 (Tue, 27 Nov 2007) | 1 line
  
  CXF-1238 DispatchInDataBindingInterceptor assumes incoming message to have been read removes out the inputstream from the message.
........
  r598464 | gmazza | 2007-11-27 07:33:05 +0800 (Tue, 27 Nov 2007) | 1 line
  
  Minor comments added.
........

Added:
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/
      - copied from r598464, incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptorTest.java
      - copied unchanged from r598464, incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptorTest.java
Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java

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

Modified: incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java?rev=598499&r1=598498&r2=598499&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java Mon Nov 26 18:58:34 2007
@@ -63,10 +63,12 @@
             return;
         }
         appMessageCount++;
+        // do not discard odd-numbered messages
         if (0 != (appMessageCount % 2)) {
             return;
         }
         
+        // discard even-numbered message
         InterceptorChain chain = message.getInterceptorChain();
         ListIterator it = chain.getIterator();
         while (it.hasNext()) {

Modified: incubator/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/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java?rev=598499&r1=598498&r2=598499&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java Mon Nov 26 18:58:34 2007
@@ -115,6 +115,7 @@
      
         try {
             InputStream is = message.getContent(InputStream.class);
+            boolean msgRead = false;
             Object obj = null;
             ex.put(Service.Mode.class, mode);            
             
@@ -123,7 +124,8 @@
                 PostDispatchSOAPHandlerInterceptor postSoap = new PostDispatchSOAPHandlerInterceptor();
                 message.getInterceptorChain().add(postSoap);
                 
-                message.setContent(SOAPMessage.class, soapMessage);               
+                message.setContent(SOAPMessage.class, soapMessage); 
+                msgRead = true;
             } else if (message instanceof XMLMessage) {
                 if (type.equals(DataSource.class)) {
                     try {
@@ -145,18 +147,22 @@
                     obj = dataReader.read(null, message.getContent(XMLStreamReader.class), readType);
                     message.setContent(Source.class, obj); 
                 }
+                msgRead = true;
             }
-    
-            PostDispatchLogicalHandlerInterceptor postLogical = new PostDispatchLogicalHandlerInterceptor();
-            message.getInterceptorChain().add(postLogical);      
             
-            is.close();
-            message.removeContent(InputStream.class);
+            if (msgRead) {
+                PostDispatchLogicalHandlerInterceptor postLogical = 
+                    new PostDispatchLogicalHandlerInterceptor();
+                message.getInterceptorChain().add(postLogical);      
+                
+                is.close();
+                message.removeContent(InputStream.class);
+            }
         } catch (Exception e) {
             throw new Fault(e);
         }
     }
-
+    
     private SOAPMessage newSOAPMessage(InputStream is, SoapMessage msg) throws Exception {
         SoapVersion version = msg.getVersion();