cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject git commit: [CXF-5539, CXF-5434] For JMS, don't create a back channel conduit if it's not needed.
Date Mon, 05 May 2014 18:48:27 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 4b2731917 -> 217cf5565


[CXF-5539, CXF-5434] For JMS, don't create a back channel conduit if it's not needed.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/217cf556
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/217cf556
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/217cf556

Branch: refs/heads/master
Commit: 217cf5565cad6dd7621cf0a7f94836874fd3b37a
Parents: 4b27319
Author: Daniel Kulp <dkulp@apache.org>
Authored: Mon May 5 14:47:48 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon May 5 14:48:21 2014 -0400

----------------------------------------------------------------------
 .../cxf/transport/jms/JMSDestination.java       |  8 +++++
 .../cxf/systest/jms/GreeterImplSoap12.java      |  5 ++++
 .../systest/jms/JMSClientServerSoap12Test.java  | 31 ++++++++++++++++++++
 3 files changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/217cf556/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
index 66eec97..b55c8f6 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
@@ -42,6 +42,7 @@ import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.security.SecurityContext;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.AbstractMultiplexDestination;
@@ -87,6 +88,13 @@ public class JMSDestination extends AbstractMultiplexDestination implements
Mess
      * @return the inbuilt backchannel
      */
     protected Conduit getInbuiltBackChannel(Message inMessage) {
+        //with JMS, non-robust OneWays will never need to send back a response, even a "202"
response.
+        boolean robust =
+            MessageUtils.isTrue(inMessage.getContextualProperty(Message.ROBUST_ONEWAY));
+        if (inMessage.getExchange().isOneWay()
+            && !robust) {
+            return null;
+        }
         return new BackChannelConduit(inMessage, jmsConfig, connection);
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/217cf556/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
index f163059..b91a63a 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplSoap12.java
@@ -19,6 +19,9 @@
 package org.apache.cxf.systest.jms;
 
 import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
+
+import org.apache.cxf.annotations.Logging;
 
 
 @WebService(serviceName = "SOAPService8", 
@@ -26,6 +29,8 @@ import javax.jws.WebService;
             endpointInterface = "org.apache.hello_world_doc_lit.Greeter",
             targetNamespace = "http://apache.org/hello_world_doc_lit",
             wsdlLocation = "testutils/hello_world_doc_lit.wsdl")
+@Addressing(required = false)
+@Logging
 public class GreeterImplSoap12 extends GreeterImplDocBase {
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/217cf556/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
index 4661c20..784c843 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerSoap12Test.java
@@ -21,10 +21,12 @@ package org.apache.cxf.systest.jms;
 import java.net.URL;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.soap.AddressingFeature;
 
 import org.apache.hello_world_doc_lit.Greeter;
 import org.apache.hello_world_doc_lit.PingMeFault;
 import org.apache.hello_world_doc_lit.SOAPService2;
+
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -65,4 +67,33 @@ public class JMSClientServerSoap12Test extends AbstractVmJMSTest {
 
         }
     }
+    @Test
+    public void testWSAddressingWithJms() throws Exception {
+        QName serviceName = new QName("http://apache.org/hello_world_doc_lit", 
+                                 "SOAPService8");
+        QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort8");
+        URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
+        SOAPService2 service = new SOAPService2(wsdl, serviceName);
+        Greeter greeter = markForClose(service.getPort(portName, Greeter.class, 
+                                                       cff, new AddressingFeature()));
+
+        for (int idx = 0; idx < 5; idx++) {
+
+            greeter.greetMeOneWay("test String");
+
+            String greeting = greeter.greetMe("Milestone-" + idx);
+            Assert.assertEquals(new String("Hello Milestone-") + idx, greeting);
+
+            String reply = greeter.sayHi();
+            Assert.assertEquals("Bonjour", reply);
+
+            try {
+                greeter.pingMe();
+                Assert.fail("Should have thrown FaultException");
+            } catch (PingMeFault ex) {
+                Assert.assertNotNull(ex.getFaultInfo());
+            }
+
+        }
+    }
 }


Mime
View raw message