1. Restructured samples to be independent from the main source tree and to be Maven-compatible
2. Modified the samples build.xml to reflect on the new structure of samples
3. Added README file
This commit is contained in:
Oleg Zhurakousky
2009-07-01 00:00:50 +00:00
parent a09ee058ec
commit e8bc39d475
97 changed files with 623 additions and 382 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ws</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,30 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>spring-integration-samples</artifactId>
<groupId>org.springframework.integration</groupId>
<version>1.0.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>ws</groupId>
<artifactId>ws</artifactId>
<version>1.0.3</version>
<dependencies>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>com.springsource.javax.xml.soap</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml</groupId>
<artifactId>com.springsource.com.sun.xml.messaging.saaj</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>com.springsource.javax.activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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;
/**
* Demonstrating a web service invocation through a Web Service MessageHandler.
*
* @author Marius Bogoevici
*/
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 =
"<FahrenheitToCelsius xmlns=\"http://tempuri.org/\">" +
" <Fahrenheit>90.0</Fahrenheit>" +
"</FahrenheitToCelsius>";
// Create the Message object
Message<String> message = MessageBuilder.withPayload(requestXml).build();
// Send the Message to the handler's input channel
MessageChannel channel = channelResolver.resolveChannelName("fahrenheitChannel");
channel.send(message);
}
}

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:ws="http://www.springframework.org/schema/integration/ws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd
http://www.springframework.org/schema/integration/ws
http://www.springframework.org/schema/integration/ws/spring-integration-ws-1.0.xsd">
<!-- This chain receives from the 'fahrenheitChannel' and enriches the request Message by adding
the "soap-action" header value. Then, the Web Service outbound Messaging Gateway invokes the
Web Service for the given URI, and the reply Message is sent to the 'celsiusChannel'. -->
<chain input-channel="fahrenheitChannel" output-channel="celsiusChannel">
<header-enricher>
<header name="springintegration_ws_soapAction" value="http://tempuri.org/FahrenheitToCelsius"/>
</header-enricher>
<ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx"/>
</chain>
<!-- The response from the service is logged to the console. -->
<stream:stdout-channel-adapter id="celsiusChannel"/>
</beans:beans>