camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r713946 - in /activemq/camel/branches/camel-1.x: ./ components/camel-cxf/ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/ components/...
Date Fri, 14 Nov 2008 07:25:48 GMT
Author: ningjiang
Date: Thu Nov 13 23:25:47 2008
New Revision: 713946

URL: http://svn.apache.org/viewvc?rev=713946&view=rev
Log:
Merged revisions 713944 via svnmerge from 
https://svn.apache.org/repos/asf/activemq/camel/trunk

........
  r713944 | ningjiang | 2008-11-14 15:17:40 +0800 (Fri, 14 Nov 2008) | 1 line
  
  CAMEL-1088 fixed the soap header bug of camel-cxf endpoint in PAYLOAD data format
........

Added:
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
      - copied unchanged from r713944, activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
      - copied unchanged from r713944, activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
      - copied unchanged from r713944, activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/resources/pizza_service.wsdl
      - copied unchanged from r713944, activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl
Modified:
    activemq/camel/branches/camel-1.x/   (props changed)
    activemq/camel/branches/camel-1.x/components/camel-cxf/pom.xml
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
    activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java

Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 13 23:25:47 2008
@@ -1 +1 @@
-/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932
+/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932,713944

Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/pom.xml?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/pom.xml (original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/pom.xml Thu Nov 13 23:25:47 2008
@@ -309,6 +309,13 @@
       							<extraarg>${basedir}/src/test/resources/person-non-wrapper-binding.xml</extraarg>
       						</extraargs>
       					</wsdlOption>
+      					<wsdlOption>
+      						<wsdl>${basedir}/src/test/resources/pizza_service.wsdl</wsdl>
+      						<extraargs>
+      							<extraarg>-exsh</extraarg>
+      							<extraarg>true</extraarg>
+      						</extraargs>
+      					</wsdlOption>
       				</wsdlOptions>
       			</configuration>
       			<goals>

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
Thu Nov 13 23:25:47 2008
@@ -116,9 +116,7 @@
         BindingMessageInfo bmi = isRequestor(message) ?  boi.getOutput() : boi.getInput();
         List<Element> partList = getPartList(message, payloadEl, bmi);
         message.put(List.class, partList);
-
-        Element header = getHeader(message);
-        message.put(Element.class, header);
+        
     }
 
     /**
@@ -160,11 +158,5 @@
      */
     protected abstract List<Element> getPartList(T inMessage, Element rootElement,
BindingMessageInfo boi);
 
-    /**
-     * This method is called when the routing message interceptor has intercepted a inbound
-     * message as a DOM Content.  It retreives the header parts as DOM Element
-     * and returns a Element.
-     */
-    protected abstract Element getHeader(T inMessage);
-
+   
 }

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
Thu Nov 13 23:25:47 2008
@@ -16,10 +16,12 @@
  */
 package org.apache.camel.component.cxf.interceptors;
 
+
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-//import java.util.ResourceBundle;
+
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -30,10 +32,11 @@
 import org.w3c.dom.Node;
 
 
+import org.apache.camel.pizza.types.CallerIDHeaderType;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.common.logging.LogUtils;
-//import org.apache.cxf.common.i18n.BundleUtils;
+
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.message.Exchange;
@@ -113,11 +116,8 @@
         return partList;
     }
 
-    protected Element getHeader(SoapMessage inMessage) {
-        // need to find out the soap header information
-        Element element = null;
-        return element;
-        // return inMessage.getHeaders(Element.class);
-    }
+   
+
+    
 
 }

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
Thu Nov 13 23:25:47 2008
@@ -57,64 +57,13 @@
     }
 
     @SuppressWarnings("unchecked")
-    public void handleMessage(SoapMessage message) throws Fault {
-        // header is not store as the element
-        Element header = message.get(Element.class);
+    public void handleMessage(SoapMessage message) throws Fault {        
 
         List<Element> payload = message.get(List.class);
         Exchange exchange = message.getExchange();
         BindingMessageInfo bmi = exchange.get(BindingMessageInfo.class);
+        //The soap header is handled by the SoapOutInterceptor
 
-
-        //Headers -represent as -Element,Body -represent as StaxStream.
-        //Check if BindingOperationInfo contains header
-        List<SoapHeaderInfo> bindingHdr = bmi.getExtensors(SoapHeaderInfo.class);
-        if (bindingHdr != null && !bindingHdr.isEmpty()) {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.info("SoapMessageOutInterceptor BindingOperation header processing.");
-            }
-
-            List<Element> headerList = new ArrayList<Element>();
-            List<Element> newPayload = new ArrayList<Element>(payload);
-            //Look for headers in Payload.
-            for (SoapHeaderInfo shi : bindingHdr) {
-                List<Element> tmpList = new ArrayList<Element>();
-                MessagePartInfo mpi = shi.getPart();
-                QName hdrName = mpi.getConcreteName();
-                for (Element el : payload) {
-                    QName elName = new QName(el.getNamespaceURI(), el.getLocalName());
-                    if (elName.equals(hdrName)) {
-                        newPayload.remove(el);
-                        tmpList.add(el);
-                    }
-                }
-
-                if (tmpList.size() > 1) {
-                    throw new Fault(new org.apache.cxf.common.i18n.Message(
-                                    "MULTIPLE_HDR_PARTS", LOG, hdrName));
-                }
-                headerList.addAll(tmpList);
-            }
-
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.info("DOMOutInterceptor Copy Payload parts to SOAPHeaders");
-            }
-            if (headerList.size() != 0) {
-                SoapVersion version = ((SoapMessage)message).getVersion();
-                header = createElement(version.getHeader(), headerList);
-            }
-            payload = newPayload;
-        }
-
-        //Set SOAP Header Element.
-        //Child Elements Could be binding specified parts or user specified headers.
-        //REVISTED the soap headers
-        //message.setHeaders(Element.class, header);
-
-        //TODO Moving Parts from Header to Payload.
-        //For e.g Payload ROuting from SOAP11 <-> SOAP12
-
-        //So write payload and header to outbound message
         if (LOG.isLoggable(Level.INFO)) {
             LOG.info("SoapMessageOutInterceptor binding operation style processing.");
         }

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
Thu Nov 13 23:25:47 2008
@@ -141,8 +141,4 @@
         return partList;
     }
     
-    protected Element getHeader(XMLMessage inMessage) {
-        return null;
-    }
-    
 }

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
Thu Nov 13 23:25:47 2008
@@ -23,7 +23,11 @@
 import java.util.logging.Logger;
 import org.w3c.dom.Element;
 
+import org.apache.camel.Headers;
+import org.apache.cxf.binding.soap.SoapHeader;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.headers.Header;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 
@@ -41,14 +45,14 @@
 
         PayloadMessage request = (PayloadMessage)contents.get(PayloadMessage.class);
 
-        Element header = request.getHeader();
+        List<SoapHeader> headers = request.getHeaders();
         List<Element> payload = request.getPayload();
 
         if (LOG.isLoggable(Level.FINEST)) {
-            LOG.finest("header = " + header + ", paylaod = " + payload);
+            LOG.finest("header = " + headers + ", paylaod = " + payload);
         }
 
-        message.put(Element.class, header);
+        message.put(Header.HEADER_LIST, headers);
         message.put(List.class, payload);
     }
 
@@ -58,7 +62,7 @@
 
         Message msg = exchange.getInMessage();
         List<Element> payload = getResponseObject(msg , responseContext, List.class);
-        Element header = exchange.getInMessage().get(Element.class);
+        List<SoapHeader> header = CastUtils.cast((List<?>)exchange.getInMessage().get(Header.HEADER_LIST));
         payloadMsg = new PayloadMessage(payload, header);
 
         if (LOG.isLoggable(Level.FINEST)) {
@@ -90,7 +94,7 @@
                 LOG.finest(payloadMessage.toString());
             }
             outMessage.put(List.class, payloadMessage.getPayload());
-            outMessage.put(Element.class, payloadMessage.getHeader());
+            outMessage.put(Header.HEADER_LIST, payloadMessage.getHeaders());
         }
     }
 
@@ -98,14 +102,14 @@
     @SuppressWarnings("unchecked")
     public Map<Class, Object> getRequestContent(Message inMessage) {
         List<Element> payload = inMessage.get(List.class);
-        Element header = inMessage.get(Element.class);
+        List<SoapHeader> headers = CastUtils.cast((List<?>)inMessage.get(Header.HEADER_LIST));
 
         if (LOG.isLoggable(Level.FINEST)) {
-            LOG.finest("Header = " + header + ", Payload = " + payload);
+            LOG.finest("Header = " + headers + ", Payload = " + payload);
         }
 
         Map<Class, Object> contents = new IdentityHashMap<Class, Object>();
-        contents.put(PayloadMessage.class, new PayloadMessage(payload, header));
+        contents.put(PayloadMessage.class, new PayloadMessage(payload, headers));
 
         return contents;
     }

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
Thu Nov 13 23:25:47 2008
@@ -17,30 +17,32 @@
 package org.apache.camel.component.cxf.invoker;
 
 import java.util.List;
-
 import org.w3c.dom.Element;
+import org.apache.cxf.binding.soap.SoapHeader;
+
+
 
 public class PayloadMessage {
     private List<Element> payload;
-    private Element header;
+    private List<SoapHeader> headers;
     
-    public PayloadMessage(List<Element> payload, Element header) {
+    public PayloadMessage(List<Element> payload, List<SoapHeader> headers) {
         this.payload = payload;
-        this.header = header;
+        this.headers = headers;
     }
     
     public List<Element> getPayload() {
         return payload;
     }
     
-    public Element getHeader() {
-        return header;
+    public List<SoapHeader> getHeaders() {
+        return headers;
     }
     
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("payload: " + payload);
-        buf.append(" header: " + header);
+        buf.append(" headers: " + headers);
         return buf.toString();
     }
 }

Modified: activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java?rev=713946&r1=713945&r2=713946&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java
(original)
+++ activemq/camel/branches/camel-1.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java
Thu Nov 13 23:25:47 2008
@@ -35,7 +35,7 @@
                 from(routerEndpointURI).process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         Message inMessage = exchange.getIn();
-                        if(inMessage instanceof CxfMessage) {
+                        if (inMessage instanceof CxfMessage) {
                             CxfMessage message = (CxfMessage) inMessage;
                             List<Element> elements = message.getMessage().get(List.class);
                             assertNotNull("We should get the elements here" , elements);



Mime
View raw message