You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by an...@apache.org on 2006/12/01 13:46:45 UTC

svn commit: r481232 - in /incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm: src/demo/ws_rm/client/Client.java src/demo/ws_rm/common/MessageLossSimulator.java ws_rm.xml

Author: andreasmyth
Date: Fri Dec  1 04:46:43 2006
New Revision: 481232

URL: http://svn.apache.org/viewvc?view=rev&rev=481232
Log:
Fix for WS-RM demo: do not install message loss simulator on server side to avoid loss of partial responses.

Modified:
    incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/client/Client.java
    incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
    incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/ws_rm.xml

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/client/Client.java?view=diff&rev=481232&r1=481231&r2=481232
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/client/Client.java (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/client/Client.java Fri Dec  1 04:46:43 2006
@@ -21,6 +21,8 @@
 
 import java.lang.reflect.UndeclaredThrowableException;
 
+import demo.ws_rm.common.MessageLossSimulator;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.hello_world_soap_http.Greeter;
@@ -40,6 +42,8 @@
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("ws_rm.xml");
             bf.setDefaultBus(bus);
+
+            bus.getOutInterceptors().add(new MessageLossSimulator());
  
             GreeterService service = new GreeterService();
             Greeter port = service.getGreeterPort();

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java?view=diff&rev=481232&r1=481231&r2=481232
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java Fri Dec  1 04:46:43 2006
@@ -36,6 +36,7 @@
 import org.apache.cxf.phase.PhaseInterceptor;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.rm.RMContextUtils;
+import org.apache.cxf.ws.rm.RMProperties;
 
 /**
  * 
@@ -103,9 +104,11 @@
             boolean af = alreadyFlushed();
             if (!af) {
                 if (LOG.isLoggable(Level.INFO)) {
-                    BigInteger nr = RMContextUtils.retrieveRMProperties(outMessage, true)
-                        .getSequence().getMessageNumber();
-                    LOG.info("Losing message " + nr);
+                    RMProperties props = RMContextUtils.retrieveRMProperties(outMessage, true);
+                    if (props != null && props.getSequence() != null) {
+                        BigInteger nr = props.getSequence().getMessageNumber();
+                        LOG.info("Losing message " + nr);
+                    }
                 }
                 resetOut(new DummyOutputStream(), true);
             }

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/ws_rm.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/ws_rm.xml?view=diff&rev=481232&r1=481231&r2=481232
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/ws_rm.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/ws_rm.xml Fri Dec  1 04:46:43 2006
@@ -36,7 +36,6 @@
     <bean id="rmCodec" class="org.apache.cxf.ws.rm.soap.RMSoapInterceptor"/>
     <bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
     <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
-    <bean id="messageLoss" class="demo.ws_rm.common.MessageLossSimulator"/>
 
     <!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. -->
 
@@ -66,7 +65,6 @@
                 <ref bean="rmLogicalOut"/>
                 <ref bean="rmCodec"/>
                 <ref bean="logOutbound"/>
-                <ref bean="messageLoss"/>
             </list>
         </property>
         <property name="outFaultInterceptors">