You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dk...@apache.org on 2011/07/08 22:04:19 UTC
svn commit: r1144471 - in /camel/branches/camel-2.7.x: ./
components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/
components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/
components/camel-spring-ws/src/test/...
Author: dkulp
Date: Fri Jul 8 20:04:19 2011
New Revision: 1144471
URL: http://svn.apache.org/viewvc?rev=1144471&view=rev
Log:
Merged revisions 1128970 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1128970 | rickette | 2011-05-29 18:14:20 -0400 (Sun, 29 May 2011) | 1 line
CAMEL-3974: Spring-WS producer now propagates headers. Thanks to Doug Douglass for providing a patch, I've polished it a bit.
........
Modified:
camel/branches/camel-2.7.x/ (props changed)
camel/branches/camel-2.7.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java
camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java
camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerLocalRouteTest-context.xml
Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 8 20:04:19 2011
@@ -1 +1 @@
-/camel/trunk:1083696,1083723-1083724,1084150,1085277,1085543,1085549,1085905,1085909,1086165,1086231,1087005,1087276,1087612,1087620,1087856,1088583,1088916-1088917,1089275,1089348,1090166,1090204,1090564,1090960-1090969,1091082,1091518,1091771,1091799,1092034,1092068,1092577,1092667,1093978,1093980,1093999,1094123,1094147,1094156,1095405,1095469,1095471,1095475-1095476,1096346,1096736,1097761,1097909,1097912,1097978,1098032,1098628,1098630,1099228,1099417,1100975,1102162,1102177,1102181,1104076,1124497,1127744,1127988,1128315,1131411,1134252,1134501,1135223,1135364,1136290,1138285,1139163,1140096-1140102,1141783,1143925,1144248,1144324
+/camel/trunk:1083696,1083723-1083724,1084150,1085277,1085543,1085549,1085905,1085909,1086165,1086231,1087005,1087276,1087612,1087620,1087856,1088583,1088916-1088917,1089275,1089348,1090166,1090204,1090564,1090960-1090969,1091082,1091518,1091771,1091799,1092034,1092068,1092577,1092667,1093978,1093980,1093999,1094123,1094147,1094156,1095405,1095469,1095471,1095475-1095476,1096346,1096736,1097761,1097909,1097912,1097978,1098032,1098628,1098630,1099228,1099417,1100975,1102162,1102177,1102181,1104076,1124497,1127744,1127988,1128315,1128970,1131411,1134252,1134501,1135223,1135364,1136290,1138285,1139163,1140096-1140102,1141783,1143925,1144248,1144324
Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.7.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java?rev=1144471&r1=1144470&r2=1144471&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java (original)
+++ camel/branches/camel-2.7.x/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java Fri Jul 8 20:04:19 2011
@@ -25,6 +25,7 @@ import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.TypeConverter;
import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.ExchangeHelper;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.client.core.SourceExtractor;
import org.springframework.ws.client.core.WebServiceMessageCallback;
@@ -57,7 +58,10 @@ public class SpringWebserviceProducer ex
} else {
body = endpoint.getConfiguration().getWebServiceTemplate().sendSourceAndReceive(sourcePayload, callback, SOURCE_EXTRACTOR);
}
- exchange.getOut().setBody(body);
+ if (ExchangeHelper.isOutCapable(exchange)) {
+ exchange.getOut().copyFrom(exchange.getIn());
+ exchange.getOut().setBody(body);
+ }
}
protected class DefaultWebserviceMessageCallback implements WebServiceMessageCallback {
Modified: camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java?rev=1144471&r1=1144470&r2=1144471&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java (original)
+++ camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java Fri Jul 8 20:04:19 2011
@@ -18,8 +18,10 @@ package org.apache.camel.component.sprin
import javax.xml.transform.Source;
+import org.apache.camel.EndpointInject;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.converter.jaxp.StringSource;
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;
@@ -37,6 +39,9 @@ public class ProducerLocalRouteTest exte
@Produce
private ProducerTemplate template;
+ @EndpointInject(uri = "mock:result")
+ private MockEndpoint resultEndpoint;
+
@Test()
public void consumeStockQuoteWebserviceWithDefaultTemplate() throws Exception {
Object result = template.requestBody("direct:stockQuoteWebserviceWithDefaultTemplate", xmlRequestForGoogleStockQuote);
@@ -46,6 +51,16 @@ public class ProducerLocalRouteTest exte
}
@Test()
+ public void consumeStockQuoteWebserviceAndPreserveHeaders() throws Exception {
+ resultEndpoint.expectedHeaderReceived("helloHeader", "hello world!");
+
+ Object result = template.requestBodyAndHeader("direct:stockQuoteWebserviceMock", xmlRequestForGoogleStockQuote, "helloHeader", "hello world!");
+
+ assertNotNull(result);
+ resultEndpoint.assertIsSatisfied();
+ }
+
+ @Test()
public void consumeStockQuoteWebservice() throws Exception {
Object result = template.requestBody("direct:stockQuoteWebservice", xmlRequestForGoogleStockQuote);
Modified: camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerLocalRouteTest-context.xml
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerLocalRouteTest-context.xml?rev=1144471&r1=1144470&r2=1144471&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerLocalRouteTest-context.xml (original)
+++ camel/branches/camel-2.7.x/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerLocalRouteTest-context.xml Fri Jul 8 20:04:19 2011
@@ -28,6 +28,13 @@
<to uri="spring-ws:http://localhost?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote"/>
</route>
<route>
+ <from uri="direct:stockQuoteWebserviceMock"/>
+ <pipeline>
+ <to uri="spring-ws:http://localhost?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote"/>
+ <to uri="mock:result" />
+ </pipeline>
+ </route>
+ <route>
<from uri="direct:stockQuoteWebserviceAsString"/>
<to uri="spring-ws:http://localhost?webServiceTemplate=#webServiceTemplate&soapAction=http://www.stockquotes.edu/GetQuote"/>
<convertBodyTo type="java.lang.String"/>