cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r687778 - in /cxf/branches/2.1.x-fixes: ./ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/ systests/src/test/java/org/apache/cxf/systest/mtom/ testutils/src/main/re...
Date Thu, 21 Aug 2008 15:12:47 GMT
Author: dkulp
Date: Thu Aug 21 08:12:47 2008
New Revision: 687778

URL: http://svn.apache.org/viewvc?rev=687778&view=rev
Log:
Merged revisions 687722 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r687722 | ffang | 2008-08-21 08:16:09 -0400 (Thu, 21 Aug 2008) | 1 line
  
  [CXF-1760] jms transport don't support MTOM
........

Added:
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java
      - copied unchanged from r687722, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/mtom/ServerWithJMS.java
      - copied unchanged from r687722, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ServerWithJMS.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/mtom/TestMtomJMSImpl.java
      - copied unchanged from r687722, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/TestMtomJMSImpl.java
Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
    cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/mtom_xop.wsdl

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 21 08:12:47 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687363,687387,687463,687543
+/cxf/trunk:686333-686363,686764,686820,687096,687363,687387,687463,687543,687722

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 21 08:12:47 2008
@@ -1 +1 @@
-/cxf/trunk:1-686342,686344-686363,686764,686820,687096,687363,687387,687463,687543
+/cxf/trunk:1-686342,686344-686363,686764,686820,687096,687363,687387,687463,687543,687722

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=687778&r1=687777&r2=687778&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
Thu Aug 21 08:12:47 2008
@@ -314,8 +314,10 @@
             if (ttl <= 0) {
                 ttl = getClientConfig().getMessageTimeToLive();
             }
-            
+             
             base.setMessageProperties(headers, jmsMessage);
+            //ensure that the contentType is set to the out jms message header
+            base.setContentToProtocalHeader(outMessage);
             Map<String, List<String>> protHeaders = 
                 CastUtils.cast((Map<?, ?>)outMessage.get(Message.PROTOCOL_HEADERS));
             base.addProtocolHeaders(jmsMessage, protHeaders);

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=687778&r1=687777&r2=687778&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Thu Aug 21 08:12:47 2008
@@ -466,6 +466,8 @@
 
                     setReplyCorrelationID(request, reply);
                     base.setMessageProperties(headers, reply);
+                    //ensure that the contentType is set to the out jms message header
+                    base.setContentToProtocalHeader(outMessage);
                     Map<String, List<String>> protHeaders = 
                         CastUtils.cast((Map<?, ?>)outMessage.get(Message.PROTOCOL_HEADERS));
                     base.addProtocolHeaders(reply, protHeaders);

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java?rev=687778&r1=687777&r2=687778&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
Thu Aug 21 08:12:47 2008
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.transport.jms;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -34,6 +35,7 @@
 import javax.jms.TextMessage;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.service.model.EndpointInfo;
 
 
@@ -161,6 +163,11 @@
             props.add(prop);
             
             protHeaders.put(name, Collections.singletonList(val));
+            if (name.equals(org.apache.cxf.message.Message.CONTENT_TYPE)
+                    && val != null) {
+                inMessage.put(org.apache.cxf.message.Message.CONTENT_TYPE, val);
+            }
+
         }
         inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, protHeaders);
         return headers;
@@ -235,4 +242,30 @@
         return JMSConstants.JMS_QUEUE.equals(
             transport.getJMSAddress().getDestinationStyle().value());
     }
+
+    protected void setContentToProtocalHeader(org.apache.cxf.message.Message message) {
+        String contentType = (String)message.get(org.apache.cxf.message.Message.CONTENT_TYPE);
+
+        Map<String, List<String>> headers = getSetProtocolHeaders(message);
+        if (headers.get(org.apache.cxf.message.Message.CONTENT_TYPE) == null) {
+            List<String> ct = new ArrayList<String>();
+            ct.add(contentType);
+            headers.put(org.apache.cxf.message.Message.CONTENT_TYPE, ct);
+        }  else {
+            List<String> ct = headers.get(org.apache.cxf.message.Message.CONTENT_TYPE);
+            ct.add(contentType);
+        }
+    }
+
+    protected Map<String, List<String>> getSetProtocolHeaders(
+            org.apache.cxf.message.Message message) {
+        Map<String, List<String>> headers =
+            CastUtils.cast((Map<?, ?>)message.get(org.apache.cxf.message.Message.PROTOCOL_HEADERS));
+        if (null == headers) {
+            headers = new HashMap<String, List<String>>();
+            message.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
+        }
+        return headers;
+    }
+
 }

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?rev=687778&r1=687777&r2=687778&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
Thu Aug 21 08:12:47 2008
@@ -380,8 +380,11 @@
         
         JMSMessageHeadersType inHeader =
             (JMSMessageHeadersType)inMessage.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
-        assertTrue("property has been excluded", inHeader.getProperty().isEmpty());
 
+        assertTrue("property has been excluded, only CONTENT_TYPE should be here",
+                inHeader.getProperty().size() == 1);
+        assertTrue("property has been excluded, only CONTENT_TYPE should be here",
+                inHeader.getProperty().get(0).getName().equals(Message.CONTENT_TYPE));
         // wait for a while for the jms session recycling
         Thread.sleep(1000);
         destination.shutdown();

Modified: cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/mtom_xop.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/mtom_xop.wsdl?rev=687778&r1=687777&r2=687778&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/mtom_xop.wsdl (original)
+++ cxf/branches/2.1.x-fixes/testutils/src/main/resources/wsdl/mtom_xop.wsdl Thu Aug 21 08:12:47
2008
@@ -22,6 +22,7 @@
 <wsdl:definitions name="SOAPBuilders-mime-cr-test" xmlns:types="http://cxf.apache.org/mime/types"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://cxf.apache.org/mime"
+    xmlns:jms="http://cxf.apache.org/transports/jms"
     xmlns:xmime="http://www.w3.org/2005/05/xmlmime" targetNamespace="http://cxf.apache.org/mime">
 
     <wsdl:types>
@@ -107,5 +108,18 @@
             <soap:address location="http://localhost:9036/mime-test" />
         </wsdl:port>
     </wsdl:service>
+    
+    <wsdl:service name="TestMtomJMSService">
+        <wsdl:port name="TestMtomJMSPort" binding="tns:TestMtomBinding">
+            <jms:address
+               destinationStyle="queue"
+               jndiConnectionFactoryName="ConnectionFactory"
+               jndiDestinationName="dynamicQueues/person.queue">
+               <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
+               <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+          </jms:address>
+
+        </wsdl:port>
+    </wsdl:service>
 
 </wsdl:definitions>



Mime
View raw message