servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r728272 - in /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc: ./ interceptors/
Date Sat, 20 Dec 2008 11:31:14 GMT
Author: ffang
Date: Sat Dec 20 03:31:13 2008
New Revision: 728272

URL: http://svn.apache.org/viewvc?rev=728272&view=rev
Log:
[SM-1743]avoid the duplicated Content-Type in the http header

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java?rev=728272&r1=728271&r2=728272&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
Sat Dec 20 03:31:13 2008
@@ -100,7 +100,6 @@
 import org.apache.servicemix.cxfbc.interceptors.JbiOperationInterceptor;
 import org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor;
 import org.apache.servicemix.cxfbc.interceptors.MtomCheckInterceptor;
-import org.apache.servicemix.cxfbc.interceptors.ParseContentTypeInterceptor;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.soap.util.DomUtil;
 import org.mortbay.jetty.Handler;
@@ -400,10 +399,7 @@
                             .getConfiguration().getAuthenticationService()));
             cxfService.getInInterceptors().add(new JbiInvokerInterceptor());
             cxfService.getInInterceptors().add(new JbiPostInvokerInterceptor());
-            if (isMtomEnabled()) {
-                cxfService.getInInterceptors().add(
-                        new ParseContentTypeInterceptor());
-            }
+            
 
             cxfService.getInInterceptors().add(new OutgoingChainInterceptor());
 

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=728272&r1=728271&r2=728272&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
Sat Dec 20 03:31:13 2008
@@ -59,7 +59,6 @@
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointImpl;
 import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.AttachmentOutInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.Interceptor;
@@ -210,18 +209,6 @@
             if (ex != null) {
                 throw ex;
             }
-            String contentType = (String) message.get(Message.CONTENT_TYPE);
-
-            Map<String, List<String>> headers = getSetProtocolHeaders(message);
-            if (headers.get(Message.CONTENT_TYPE) == null) {
-                List<String> ct = new ArrayList<String>();
-                ct.add(contentType);
-                headers.put(Message.CONTENT_TYPE, ct);
-            } else {
-                List<String> ct = headers.get(Message.CONTENT_TYPE);
-                ct.add(contentType);
-            }
-
             os = message.getContent(OutputStream.class);
             os.flush();
             is.close();
@@ -266,15 +253,6 @@
         return outChain;
     }
 
-    private Map<String, List<String>> getSetProtocolHeaders(Message message)
{
-        Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>)
message
-                .get(Message.PROTOCOL_HEADERS));
-        if (null == headers) {
-            headers = new HashMap<String, List<String>>();
-            message.put(Message.PROTOCOL_HEADERS, headers);
-        }
-        return headers;
-    }
 
     private void faultProcess(MessageExchange exchange, Message message,
             Exception e) throws MessagingException {

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java?rev=728272&r1=728271&r2=728272&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
Sat Dec 20 03:31:13 2008
@@ -49,7 +49,7 @@
 import org.apache.cxf.transport.MessageObserver;
 import org.apache.servicemix.JbiConstants;
 import org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor;
-import org.apache.servicemix.cxfbc.interceptors.ParseContentTypeInterceptor;
+
 
 
 public class CxfBcProviderMessageObserver implements MessageObserver {
@@ -128,7 +128,6 @@
             inList.add(new JbiInWsdl1Interceptor(this.providerEndpoint.isUseJBIWrapper(),
                     this.providerEndpoint.isUseSOAPEnvelope()));
             inList.add(new AttachmentInInterceptor());
-            inList.add(new ParseContentTypeInterceptor());
             PhaseInterceptorChain inChain = inboundChainCache.get(pm
                     .getInPhases(), inList);
             inChain.add(providerEndpoint.getInInterceptors());

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java?rev=728272&r1=728271&r2=728272&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java
Sat Dec 20 03:31:13 2008
@@ -17,10 +17,8 @@
 package org.apache.servicemix.cxfbc.interceptors;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -39,7 +37,6 @@
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.headers.Header;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.NSStack;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Message;
@@ -149,8 +146,7 @@
             if ("rpc".equals(style)) {
                 xmlWriter.writeEndElement();
             }
-            
-            setContentType(message);
+                       
         } catch (Fault e) {
             throw e;
         } catch (Exception e) {
@@ -176,25 +172,6 @@
 
     
     
-    private void setContentType(SoapMessage message) {
-        String contentType = (String) message.get(Message.CONTENT_TYPE);
-        Map<String, List<String>> headers =
-            CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));     
  
-        if (null == headers) {
-            headers = new HashMap<String, List<String>>();
-            message.put(Message.PROTOCOL_HEADERS, headers);
-        }
-        if (headers.get(Message.CONTENT_TYPE) == null) {
-            List<String> ct = new ArrayList<String>();
-            ct.add(contentType);
-            headers.put(Message.CONTENT_TYPE, ct);
-        }  else {
-            List<String> ct = headers.get(Message.CONTENT_TYPE);
-            ct.add(contentType);
-        }
-        
-    }
-
     private void getRPCPartWrapper(BindingMessageInfo msg, 
                                    Element element,
                                    SoapMessage message, 



Mime
View raw message