servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r704459 - in /servicemix/components/bindings/servicemix-cxf-bc/trunk/src: main/java/org/apache/servicemix/cxfbc/ main/java/org/apache/servicemix/cxfbc/interceptors/ test/resources/org/apache/servicemix/cxfbc/
Date Tue, 14 Oct 2008 11:04:52 GMT
Author: ffang
Date: Tue Oct 14 04:04:50 2008
New Revision: 704459

URL: http://svn.apache.org/viewvc?rev=704459&view=rev
Log:
[SM-1602|SM1603]Cxf bc provider should handle MTOM response correctly regardless of the mtomEnabled
flag value

Modified:
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/mtom_bridge_http_jms.xml

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java?rev=704459&r1=704458&r2=704459&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
Tue Oct 14 04:04:50 2008
@@ -126,9 +126,7 @@
             inList.add(new MustUnderstandInterceptor());
             inList.add(new StaxInInterceptor());
             inList.add(new JbiInWsdl1Interceptor(this.providerEndpoint.isUseJBIWrapper()));
-            if (providerEndpoint.isMtomEnabled()) {
-                inList.add(new AttachmentInInterceptor());
-            }
+            inList.add(new AttachmentInInterceptor());
             PhaseInterceptorChain inChain = inboundChainCache.get(pm
                     .getInPhases(), inList);
             inChain.add(providerEndpoint.getInInterceptors());
@@ -148,17 +146,13 @@
             } else if (messageExchange instanceof InOut) {
                 NormalizedMessage msg = messageExchange.createMessage();
                 msg.setContent(soapMessage.getContent(Source.class));
-                if (providerEndpoint.isMtomEnabled()) {
-                    toNMSAttachments(msg, soapMessage);
-                }
+                toNMSAttachments(msg, soapMessage);
                 messageExchange.setMessage(msg, "out");
             } else if (messageExchange instanceof InOptionalOut) {
                 if (soapMessage.getContent(Source.class) != null) {
                     NormalizedMessage msg = messageExchange.createMessage();
                     msg.setContent(soapMessage.getContent(Source.class));
-                    if (providerEndpoint.isMtomEnabled()) {
-                        toNMSAttachments(msg, soapMessage);
-                    }
+                    toNMSAttachments(msg, soapMessage);
                     messageExchange.setMessage(msg, "out");
                 } else {
                     messageExchange.setStatus(ExchangeStatus.DONE);

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java?rev=704459&r1=704458&r2=704459&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutInterceptor.java
Tue Oct 14 04:04:50 2008
@@ -38,6 +38,7 @@
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.headers.Header;
+import org.apache.cxf.interceptor.AttachmentOutInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Message;
@@ -164,11 +165,17 @@
             attachmentList.add(attachment);
         }
         message.setAttachments(attachmentList);
+        
         if (message instanceof SoapMessage) {
             SoapMessage soapMessage = (SoapMessage)message;
             SoapVersion soapVersion = soapMessage.getVersion();
             message.put(Message.CONTENT_TYPE, soapVersion.getContentType());
         }
+        if (attachmentList.size() > 0) {
+            message.put(org.apache.cxf.message.Message.MTOM_ENABLED, true);
+            message.put("write.attachments", true);
+            message.getInterceptorChain().add(new AttachmentOutInterceptor());
+        }
         
     }
 
@@ -210,6 +217,8 @@
                 }
             }
         }
+        
+        
     }
 
     private boolean isRequestor(org.apache.cxf.message.Message message) {

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/mtom_bridge_http_jms.xml
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/mtom_bridge_http_jms.xml?rev=704459&r1=704458&r2=704459&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/mtom_bridge_http_jms.xml
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/mtom_bridge_http_jms.xml
Tue Oct 14 04:04:50 2008
@@ -50,7 +50,7 @@
                       service="mtom:TestMtomProviderService"
                       endpoint="TestMtomProviderJmsPort"
                       interfaceName="mtom:TestMtom"
-                      mtomEnabled="true"
+                      mtomEnabled="false"
                      >
           <cxfbc:inInterceptors>
             <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>



Mime
View raw message