diff --git a/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/WebServiceDemo.java b/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/WebServiceDemo.java index 94a4c60531..6437a7098f 100644 --- a/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/WebServiceDemo.java +++ b/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/WebServiceDemo.java @@ -17,10 +17,11 @@ package org.springframework.integration.samples.ws; import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.integration.channel.BeanFactoryChannelResolver; +import org.springframework.integration.channel.ChannelResolver; import org.springframework.integration.core.Message; import org.springframework.integration.core.MessageChannel; import org.springframework.integration.message.MessageBuilder; -import org.springframework.integration.ws.WebServiceHeaders; /** * Demonstrating a web service invocation through a Web Service MessageHandler. @@ -31,6 +32,7 @@ public class WebServiceDemo { public static void main(String[] args) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("temperatureConversion.xml", WebServiceDemo.class); + ChannelResolver channelResolver = new BeanFactoryChannelResolver(context); // Compose the XML message according to the server's schema String requestXml = @@ -39,13 +41,11 @@ public class WebServiceDemo { ""; // Create the Message object - // In this case the service expects a SoapAction header - Message message = MessageBuilder.withPayload(requestXml) - .setHeader(WebServiceHeaders.SOAP_ACTION, "http://tempuri.org/FahrenheitToCelsius") - .build(); + Message message = MessageBuilder.withPayload(requestXml).build(); // Send the Message to the handler's input channel - ((MessageChannel) context.getBean("fahrenheitChannel")).send(message); + MessageChannel channel = channelResolver.resolveChannelName("fahrenheitChannel"); + channel.send(message); } } diff --git a/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/temperatureConversion.xml b/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/temperatureConversion.xml index 00dc9e4997..3226cbf4bb 100644 --- a/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/temperatureConversion.xml +++ b/org.springframework.integration.samples/src/main/java/org/springframework/integration/samples/ws/temperatureConversion.xml @@ -13,15 +13,15 @@ http://www.springframework.org/schema/integration/ws http://www.springframework.org/schema/integration/ws/spring-integration-ws-1.0.xsd"> - - - - + + + +
+ + + diff --git a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/config/spring-integration-ws-1.0.xsd b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/config/spring-integration-ws-1.0.xsd index 74f8ff620d..290a39ac0d 100644 --- a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/config/spring-integration-ws-1.0.xsd +++ b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/config/spring-integration-ws-1.0.xsd @@ -29,7 +29,7 @@ - +