servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r727307 - in /servicemix/components/engines/servicemix-cxf-se/trunk/src: main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java test/java/org/apache/servicemix/cxfse/CxfSeContextInjectionTest.java
Date Wed, 17 Dec 2008 07:49:00 GMT
Author: ffang
Date: Tue Dec 16 23:49:00 2008
New Revision: 727307

URL: http://svn.apache.org/viewvc?rev=727307&view=rev
Log:
[SM-1737]cxf bc provider and cxf se doesn't send DONE back when use oneway

Modified:
    servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
    servicemix/components/engines/servicemix-cxf-se/trunk/src/test/java/org/apache/servicemix/cxfse/CxfSeContextInjectionTest.java

Modified: servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?rev=727307&r1=727306&r2=727307&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
(original)
+++ servicemix/components/engines/servicemix-cxf-se/trunk/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
Tue Dec 16 23:49:00 2008
@@ -28,6 +28,7 @@
 import javax.jbi.management.DeploymentException;
 import javax.jbi.messaging.DeliveryChannel;
 import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.MessageExchange;
 import javax.wsdl.WSDLException;
 import javax.wsdl.factory.WSDLFactory;
@@ -358,6 +359,11 @@
 			if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
 				jbiDestination.getJBIDispatcherUtil().dispatch(exchange);
 			}
+                        if (exchange instanceof InOnly) {
+                            exchange.setStatus(ExchangeStatus.DONE);
+                            dc.send(exchange);
+                        }
+                        
 		} finally {
 			JBIContext.setMessageExchange(null);
 		}

Modified: servicemix/components/engines/servicemix-cxf-se/trunk/src/test/java/org/apache/servicemix/cxfse/CxfSeContextInjectionTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-cxf-se/trunk/src/test/java/org/apache/servicemix/cxfse/CxfSeContextInjectionTest.java?rev=727307&r1=727306&r2=727307&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-cxf-se/trunk/src/test/java/org/apache/servicemix/cxfse/CxfSeContextInjectionTest.java
(original)
+++ servicemix/components/engines/servicemix-cxf-se/trunk/src/test/java/org/apache/servicemix/cxfse/CxfSeContextInjectionTest.java
Tue Dec 16 23:49:00 2008
@@ -18,7 +18,7 @@
 
 import java.util.logging.Logger;
 
-import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.MessageExchange;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.logging.LogUtils;
@@ -33,15 +33,10 @@
 
     private static final Logger LOG = LogUtils.getL7dLogger(CxfSeContextInjectionTest.class);
     private DefaultServiceMixClient client;
-    private InOut io;
+    private MessageExchange io;
     
     protected void setUp() throws Exception {
         super.setUp();
-        client = new DefaultServiceMixClient(jbi);
-        io = client.createInOutExchange();
-        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
-        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
-        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
     }
     
     protected void tearDown() throws Exception {
@@ -50,7 +45,12 @@
     
     public void testContextInjection() throws Exception {
         LOG.info("test Injection");
-        io.getInMessage().setContent(new StringSource(
+        client = new DefaultServiceMixClient(jbi);
+        io = client.createInOutExchange();
+        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
+        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
+        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
+        io.getMessage("in").setContent(new StringSource(
                 "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
               + "<part> "
               + "<greetMe xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
@@ -61,8 +61,27 @@
         client.sendSync(io);
         // the injected context belong to servicemix-cxfse component 
         assertTrue(new SourceTransformer().contentToString(
-              io.getOutMessage()).indexOf("Hello ffang servicemix-cxfse") > 0);
-        client.done(io);
+              io.getMessage("out")).indexOf("Hello ffang servicemix-cxfse") > 0);
+        
+    }
+    
+    public void testContextInjectionOneway() throws Exception {
+        LOG.info("test Injection");
+        client = new DefaultServiceMixClient(jbi);
+        io = client.createInOnlyExchange();
+        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
+        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
+        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMeOneWay"));
+        io.getMessage("in").setContent(new StringSource(
+                "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
+              + "<part> "
+              + "<greetMeOneWay xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
+              + "ffang"
+              + "</requestType></greetMeOneWay>"
+              + "</part> "
+              + "</message>"));
+        client.sendSync(io);
+        assertNull(io.getMessage("out"));
         
     }
 



Mime
View raw message