camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1143965 - in /camel/branches/camel-2.7.x: ./ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/ components/camel-cxf/src/test/java/org/apache/camel/component/cxf/
Date Thu, 07 Jul 2011 18:44:57 GMT
Author: dkulp
Date: Thu Jul  7 18:44:57 2011
New Revision: 1143965

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

........
  r1098630 | wtam | 2011-05-02 11:35:54 -0400 (Mon, 02 May 2011) | 1 line
  
  Commit fix for [CAMEL-3927] on behalf of Aki Yoshida
........

Added:
    camel/branches/camel-2.7.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadProviderTest.java
      - copied unchanged from r1098630, camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerPayloadProviderTest.java
Modified:
    camel/branches/camel-2.7.x/   (props changed)
    camel/branches/camel-2.7.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
    camel/branches/camel-2.7.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul  7 18:44:57 2011
@@ -1 +1 @@
-/camel/trunk:1083696,1084150,1085905,1086231,1087276,1087612,1087856,1088583,1088916-1088917,1089275,1090166,1090960-1090969,1091518,1091771,1091799,1092068,1092577,1092667,1093978,1094156,1095405,1095469,1095471,1095475-1095476,1097909,1097912,1099417,1100975,1102162,1102181,1104076,1124497,1127744,1127988,1131411,1134252,1134501,1135364,1139163,1143925
+/camel/trunk:1083696,1084150,1085905,1086231,1087276,1087612,1087856,1088583,1088916-1088917,1089275,1090166,1090960-1090969,1091518,1091771,1091799,1092068,1092577,1092667,1093978,1094156,1095405,1095469,1095471,1095475-1095476,1097909,1097912,1098630,1099417,1100975,1102162,1102181,1104076,1124497,1127744,1127988,1131411,1134252,1134501,1135364,1139163,1143925

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

Modified: camel/branches/camel-2.7.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java?rev=1143965&r1=1143964&r2=1143965&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
(original)
+++ camel/branches/camel-2.7.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
Thu Jul  7 18:44:57 2011
@@ -29,9 +29,11 @@ import java.util.TreeMap;
 import javax.activation.DataHandler;
 import javax.security.auth.Subject;
 import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.ws.Holder;
 
+import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -676,8 +678,13 @@ public class DefaultCxfBinding implement
                 part = ((Holder)part).value;
             }
                         
-            if (part instanceof DOMSource) {
-                Element element = getFirstElement(((DOMSource)part).getNode());
+            if (part instanceof Source) {
+                Element element;
+                if (part instanceof DOMSource) {
+                    element = getFirstElement(((DOMSource)part).getNode());
+                } else {
+                    element = getFirstElement((Source)part);
+                }
 
                 if (element != null) {
                     answer.add(element);
@@ -687,7 +694,6 @@ public class DefaultCxfBinding implement
                     LOG.trace("Extract body element " 
                               + (element == null ? "null" : XMLUtils.toString(element)));
                 }
-                
             } else if (part instanceof Element) {
                 answer.add((Element)part);
             } else {
@@ -722,6 +728,15 @@ public class DefaultCxfBinding implement
         return DOMUtils.getFirstElement(node);
     }
     
+    private static Element getFirstElement(Source source) {
+        try {
+            return ((Document)XMLUtils.fromSource(source)).getDocumentElement();
+        } catch (Exception e) {
+            // ignore
+        }
+        return null;
+    }
+    
     public void copyJaxWsContext(org.apache.cxf.message.Exchange cxfExchange, Map<String,
Object> context) {
         if (cxfExchange.getOutMessage() != null) {
             org.apache.cxf.message.Message outMessage = cxfExchange.getOutMessage();

Modified: camel/branches/camel-2.7.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java?rev=1143965&r1=1143964&r2=1143965&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java
(original)
+++ camel/branches/camel-2.7.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java
Thu Jul  7 18:44:57 2011
@@ -17,7 +17,6 @@
 
 package org.apache.camel.component.cxf;
 
-import java.util.List;
 
 import org.w3c.dom.Node;
 
@@ -27,9 +26,6 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.converter.jaxp.XmlConverter;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.frontend.ClientFactoryBean;
-import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.junit.Test;
 
 public class CxfConsumerProviderTest extends CamelTestSupport {
@@ -52,7 +48,7 @@ public class CxfConsumerProviderTest ext
         return new RouteBuilder() {
             public void configure() {
                 errorHandler(noErrorHandler());
-                from(SIMPLE_ENDPOINT_URI).process(new Processor() {
+                from(getFromEndpointUri()).process(new Processor() {
                     public void process(final Exchange exchange) {
                         Message in = exchange.getIn();
                         // Get the parameter list
@@ -87,5 +83,9 @@ public class CxfConsumerProviderTest ext
         assertTrue("Get a wrong response ", response.endsWith(RESPONSE_MESSAGE_END));
     }
 
+    
+    protected String getFromEndpointUri() {
+        return SIMPLE_ENDPOINT_URI;
+    }
 
 }



Mime
View raw message