You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/11/05 06:56:46 UTC
svn commit: r1031442 [1/2] - in /camel/trunk: apache-camel/
apache-camel/src/main/descriptors/ components/ components/camel-spring-ws/
components/camel-spring-ws/src/ components/camel-spring-ws/src/main/
components/camel-spring-ws/src/main/java/ compon...
Author: davsclaus
Date: Fri Nov 5 05:56:45 2010
New Revision: 1031442
URL: http://svn.apache.org/viewvc?rev=1031442&view=rev
Log:
CAMEL-3105: spring-ws component. Thanks to Richard Kettelerij for donating the component to Apache.
Added:
camel/trunk/components/camel-spring-ws/ (with props)
camel/trunk/components/camel-spring-ws/pom.xml (with props)
camel/trunk/components/camel-spring-ws/src/
camel/trunk/components/camel-spring-ws/src/main/
camel/trunk/components/camel-spring-ws/src/main/java/
camel/trunk/components/camel-spring-ws/src/main/java/org/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceComponent.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceEndpoint.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceMessage.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointDispatcher.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointMapping.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/StringSourceConverter.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingKey.java (with props)
camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingType.java (with props)
camel/trunk/components/camel-spring-ws/src/main/resources/
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/LICENSE.txt (with props)
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/NOTICE.txt (with props)
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/services/
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/services/org/
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/services/org/apache/
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/services/org/apache/camel/
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/services/org/apache/camel/component/
camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/services/org/apache/camel/component/spring-ws
camel/trunk/components/camel-spring-ws/src/test/
camel/trunk/components/camel-spring-ws/src/test/java/
camel/trunk/components/camel-spring-ws/src/test/java/org/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ConsumerEndpointMappingByBeanNameRouteTest.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ConsumerEndpointMappingResponseHandlingRouteTest.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ConsumerEndpointMappingRouteTest.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ConsumerMarshallingRouteTest.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerRemoteRouteTest.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/StockQuoteResponseProcessor.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/jaxb/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/jaxb/QuoteRequest.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/jaxb/QuoteResponse.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/jaxb/package-info.java (with props)
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/util/
camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/util/FileUtil.java (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/
camel/trunk/components/camel-spring-ws/src/test/resources/log4j.properties (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/org/
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ConsumerEndpointMappingByBeanNameRouteTest-context.xml (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ConsumerEndpointMappingResponseHandlingRouteTest-context.xml (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ConsumerEndpointMappingRouteTest-context.xml (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ConsumerMarshallingRouteTest-context.xml (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerLocalRouteTest-context.xml (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/ProducerRemoteRouteTest-context.xml (with props)
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/jaxb/
camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/jaxb/jaxb.index
camel/trunk/components/camel-spring-ws/src/test/resources/stockquote-response.xml (with props)
Modified:
camel/trunk/apache-camel/pom.xml
camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
camel/trunk/components/pom.xml
camel/trunk/parent/pom.xml
Modified: camel/trunk/apache-camel/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/pom.xml?rev=1031442&r1=1031441&r2=1031442&view=diff
==============================================================================
--- camel/trunk/apache-camel/pom.xml (original)
+++ camel/trunk/apache-camel/pom.xml Fri Nov 5 05:56:45 2010
@@ -342,6 +342,10 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring-ws</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-sql</artifactId>
</dependency>
<dependency>
Modified: camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/src/main/descriptors/common-bin.xml?rev=1031442&r1=1031441&r2=1031442&view=diff
==============================================================================
--- camel/trunk/apache-camel/src/main/descriptors/common-bin.xml (original)
+++ camel/trunk/apache-camel/src/main/descriptors/common-bin.xml Fri Nov 5 05:56:45 2010
@@ -106,6 +106,7 @@
<include>org.apache.camel:camel-spring-integration</include>
<include>org.apache.camel:camel-spring-javaconfig</include>
<include>org.apache.camel:camel-spring-security</include>
+ <include>org.apache.camel:camel-spring-ws</include>
<include>org.apache.camel:camel-sql</include>
<include>org.apache.camel:camel-stream</include>
<include>org.apache.camel:camel-stringtemplate</include>
Propchange: camel/trunk/components/camel-spring-ws/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 5 05:56:45 2010
@@ -0,0 +1,9 @@
+.checkstyle
+.pmd
+target
+eclipse-classes
+.classpath
+.project
+.settings
+res
+*.i??
Added: camel/trunk/components/camel-spring-ws/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/pom.xml?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/pom.xml (added)
+++ camel/trunk/components/camel-spring-ws/pom.xml Fri Nov 5 05:56:45 2010
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+-->
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-parent</artifactId>
+ <version>2.6-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-spring-ws</artifactId>
+ <packaging>bundle</packaging>
+ <name>Camel :: Spring Web Services</name>
+ <description>Camel support for Spring Web Services</description>
+
+ <properties>
+ <camel.osgi.export.pkg>org.apache.camel.component.spring.ws.*</camel.osgi.export.pkg>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>spring.maven.release</id>
+ <name>Spring Release Maven Repo</name>
+ <url>http://repository.springsource.com/maven/bundles/release</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.ws</groupId>
+ <artifactId>spring-ws-core</artifactId>
+ <version>${spring-ws-version}</version>
+ <!-- spring-webmvc is only used by Spring 2.5 -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.ws</groupId>
+ <artifactId>spring-ws-support</artifactId>
+ <version>${spring-ws-version}</version>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jaxb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.javacrumbs</groupId>
+ <artifactId>spring-ws-test</artifactId>
+ <version>0.19</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>spring-2.x</id>
+ <dependencies>
+ <!-- need spring-webmvc when using Spring 2.x -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring-version}</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+</project>
Propchange: camel/trunk/components/camel-spring-ws/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: camel/trunk/components/camel-spring-ws/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceComponent.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceComponent.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceComponent.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,155 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+import javax.xml.transform.TransformerFactory;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher;
+import org.apache.camel.component.spring.ws.bean.CamelEndpointMapping;
+import org.apache.camel.component.spring.ws.type.EndpointMappingKey;
+import org.apache.camel.component.spring.ws.type.EndpointMappingType;
+import org.apache.camel.converter.jaxp.XmlConverter;
+import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.util.CamelContextHelper;
+import org.apache.camel.util.UnsafeUriCharactersEncoder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.ws.WebServiceMessageFactory;
+import org.springframework.ws.client.core.WebServiceTemplate;
+import org.springframework.ws.transport.WebServiceMessageSender;
+import org.springframework.xml.xpath.XPathExpression;
+import org.springframework.xml.xpath.XPathExpressionFactory;
+
+/**
+ * Apache Camel component for working with Spring Web Services (a.k.a Spring-WS).
+ */
+public class SpringWebserviceComponent extends DefaultComponent {
+ private static final Log LOG = LogFactory.getLog(SpringWebserviceComponent.class);
+
+ public SpringWebserviceComponent() {
+ super();
+ }
+
+ public SpringWebserviceComponent(CamelContext context) {
+ super(context);
+ }
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+ SpringWebserviceConfiguration configuration = new SpringWebserviceConfiguration();
+ addConsumerConfiguration(remaining, parameters, configuration);
+ addProducerConfiguration(remaining, parameters, configuration);
+ addXmlConverterToConfiguration(parameters, configuration);
+ setProperties(configuration, parameters);
+ return new SpringWebserviceEndpoint(this, configuration);
+ }
+
+ private void addConsumerConfiguration(String remaining, Map<String, Object> parameters,
+ SpringWebserviceConfiguration configuration) {
+ EndpointMappingType type = EndpointMappingType.getTypeFromUriPrefix(remaining);
+ if (type != null) {
+ LOG.debug("Building Spring Web Services consumer of type " + type);
+ String lookupKey = getLookupKey(remaining, type);
+ if (EndpointMappingType.BEANNAME.equals(type)) {
+ addEndpointDispatcherToConfiguration(configuration, lookupKey);
+ } else {
+ addEndpointMappingToConfiguration(parameters, configuration);
+ }
+ if (EndpointMappingType.XPATHRESULT.equals(type)) {
+ XPathExpression expression = getXPathExpressionFromParameters(parameters);
+ configuration.setEndpointMappingKey(new EndpointMappingKey(type, lookupKey, expression));
+ } else {
+ configuration.setEndpointMappingKey(new EndpointMappingKey(type, lookupKey, null));
+ }
+ }
+ }
+
+ private void addProducerConfiguration(String remaining, Map<String, Object> parameters,
+ SpringWebserviceConfiguration configuration) throws URISyntaxException {
+ if (configuration.getEndpointMapping() == null && configuration.getEndpointDispatcher() == null) {
+ LOG.debug("Building Spring Web Services producer");
+ URI webServiceEndpointUri = new URI(UnsafeUriCharactersEncoder.encode(remaining));
+
+ // Obtain a WebServiceTemplate from the registry when specified by
+ // an option on the component, else create a new template with
+ // Spring-WS defaults
+ WebServiceTemplate webServiceTemplate = resolveAndRemoveReferenceParameter(parameters,
+ "webServiceTemplate", WebServiceTemplate.class, new WebServiceTemplate());
+ WebServiceMessageSender messageSender = resolveAndRemoveReferenceParameter(parameters,
+ "messageSender", WebServiceMessageSender.class, null);
+ WebServiceMessageFactory messageFactory = resolveAndRemoveReferenceParameter(parameters,
+ "messageFactory", WebServiceMessageFactory.class, null);
+
+ if (webServiceTemplate.getDefaultUri() == null) {
+ webServiceTemplate.setDefaultUri(webServiceEndpointUri.toString());
+ }
+ if (messageSender != null) {
+ webServiceTemplate.setMessageSender(messageSender);
+ }
+ if (messageFactory != null) {
+ webServiceTemplate.setMessageFactory(messageFactory);
+ }
+ configuration.setWebServiceTemplate(webServiceTemplate);
+ }
+ }
+
+ private String getLookupKey(String remaining, EndpointMappingType type) {
+ String lookupKey = remaining.substring(type.getPrefix().length());
+ return lookupKey.startsWith("//") ? lookupKey.substring(2) : lookupKey;
+ }
+
+ private XPathExpression getXPathExpressionFromParameters(Map<String, Object> parameters) {
+ String xpathExpression = getAndRemoveParameter(parameters, "expression", String.class);
+ if (xpathExpression == null) {
+ throw new RuntimeCamelException("Expression parameter is required when using XPath endpoint mapping");
+ }
+ XPathExpression expression = XPathExpressionFactory.createXPathExpression(xpathExpression);
+ return expression;
+ }
+
+ private void addEndpointMappingToConfiguration(Map<String, Object> parameters,
+ SpringWebserviceConfiguration configuration) {
+ // Obtain generic CamelEndpointMapping from registry
+ CamelEndpointMapping endpointMapping = resolveAndRemoveReferenceParameter(parameters, "endpointMapping", CamelEndpointMapping.class, null);
+ if (endpointMapping == null && configuration.getEndpointDispatcher() == null) {
+ throw new IllegalArgumentException("No CamelEndpointMapping found in Spring ApplicationContext."
+ + " This bean is required for Spring-WS consumer support (unless the 'spring-ws:beanname:' URI scheme is used)");
+ }
+ configuration.setEndpointMapping(endpointMapping);
+ }
+
+ private void addEndpointDispatcherToConfiguration(SpringWebserviceConfiguration configuration, String lookupKey) {
+ // Obtain CamelEndpointDispatcher with the given name from registry
+ CamelEndpointDispatcher endpoint = CamelContextHelper.mandatoryLookup(getCamelContext(), lookupKey, CamelEndpointDispatcher.class);
+ configuration.setEndpointDispatcher(endpoint);
+ }
+
+ private void addXmlConverterToConfiguration(Map<String, Object> parameters, SpringWebserviceConfiguration configuration) {
+ XmlConverter xmlConverter = new XmlConverter();
+ TransformerFactory transformerFactory = resolveAndRemoveReferenceParameter(parameters, "transformerFactory", TransformerFactory.class, null);
+ if (transformerFactory != null) {
+ xmlConverter.setTransformerFactory(transformerFactory);
+ }
+ configuration.setXmlConverter(xmlConverter);
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,111 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher;
+import org.apache.camel.component.spring.ws.bean.CamelEndpointMapping;
+import org.apache.camel.component.spring.ws.type.EndpointMappingKey;
+import org.apache.camel.converter.jaxp.XmlConverter;
+import org.springframework.ws.client.core.WebServiceTemplate;
+
+public class SpringWebserviceConfiguration {
+
+ /* Producer configuration */
+ private WebServiceTemplate webServiceTemplate;
+ private String soapAction;
+ private URI wsAddressingAction;
+
+ /* Consumer configuration */
+ private CamelEndpointMapping endpointMapping;
+ private CamelEndpointDispatcher endpointDispatcher;
+ private EndpointMappingKey endpointMappingKey;
+
+ private XmlConverter xmlConverter;
+
+ public WebServiceTemplate getWebServiceTemplate() {
+ return webServiceTemplate;
+ }
+
+ public void setWebServiceTemplate(WebServiceTemplate webServiceTemplate) {
+ this.webServiceTemplate = webServiceTemplate;
+ }
+
+ public String getSoapAction() {
+ return soapAction;
+ }
+
+ public void setSoapAction(String soapAction) {
+ this.soapAction = soapAction;
+ }
+
+ public String getEndpointUri() {
+ if (endpointMappingKey != null) {
+ // only for consumers, use lookup key as endpoint uri/key
+ return endpointMappingKey.getLookupKey();
+ } else if (webServiceTemplate != null) {
+ return webServiceTemplate.getDefaultUri();
+ }
+ return null;
+ }
+
+ public URI getWsAddressingAction() {
+ return wsAddressingAction;
+ }
+
+ public void setWsAddressingAction(URI wsAddressingAction) {
+ this.wsAddressingAction = wsAddressingAction;
+ }
+
+ public void setWsAddressingAction(String wsAddressingAction) throws URISyntaxException {
+ this.wsAddressingAction = new URI(wsAddressingAction);
+ }
+
+ public CamelEndpointMapping getEndpointMapping() {
+ return endpointMapping;
+ }
+
+ public void setEndpointMapping(CamelEndpointMapping endpointMapping) {
+ this.endpointMapping = endpointMapping;
+ }
+
+ public EndpointMappingKey getEndpointMappingKey() {
+ return endpointMappingKey;
+ }
+
+ public void setEndpointMappingKey(EndpointMappingKey endpointMappingKey) {
+ this.endpointMappingKey = endpointMappingKey;
+ }
+
+ public CamelEndpointDispatcher getEndpointDispatcher() {
+ return endpointDispatcher;
+ }
+
+ public void setEndpointDispatcher(CamelEndpointDispatcher endpointDispatcher) {
+ this.endpointDispatcher = endpointDispatcher;
+ }
+
+ public XmlConverter getXmlConverter() {
+ return xmlConverter;
+ }
+
+ public void setXmlConverter(XmlConverter xmlConverter) {
+ this.xmlConverter = xmlConverter;
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws;
+
+public final class SpringWebserviceConstants {
+
+ /* Producer constants */
+ public static final String SPRING_WS_ENDPOINT_URI = "CamelSpringWebserviceEndpointUri";
+ public static final String SPRING_WS_SOAP_ACTION = "CamelSpringWebserviceSoapAction";
+ public static final String SPRING_WS_ADDRESSING_ACTION = "CamelSpringWebserviceAddressingAction";
+
+ private SpringWebserviceConstants() {
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConstants.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,134 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.Processor;
+import org.apache.camel.converter.jaxp.XmlConverter;
+import org.apache.camel.impl.DefaultConsumer;
+import org.apache.camel.impl.DefaultExchange;
+import org.springframework.ws.WebServiceMessage;
+import org.springframework.ws.context.MessageContext;
+import org.springframework.ws.server.endpoint.MessageEndpoint;
+import org.springframework.ws.soap.SoapHeader;
+import org.springframework.ws.soap.SoapHeaderElement;
+import org.springframework.ws.soap.SoapMessage;
+
+public class SpringWebserviceConsumer extends DefaultConsumer implements MessageEndpoint {
+
+ private SpringWebserviceEndpoint endpoint;
+ private SpringWebserviceConfiguration configuration;
+
+ public SpringWebserviceConsumer(Endpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ this.endpoint = (SpringWebserviceEndpoint) endpoint;
+ this.configuration = this.endpoint.getConfiguration();
+ }
+
+ /**
+ * Invoked by Spring-WS when a {@link WebServiceMessage} is received
+ */
+ public void invoke(MessageContext messageContext) throws Exception {
+ Exchange exchange = new DefaultExchange(endpoint.getCamelContext(), ExchangePattern.InOptionalOut);
+ populateExchangeFromMessageContext(messageContext, exchange);
+
+ // start message processing
+ getProcessor().process(exchange);
+
+ // create webservice response from output body
+ if (exchange.getPattern().isOutCapable()) {
+ Message responseMessage = exchange.getOut(Message.class);
+ if (responseMessage != null) {
+ Source responseBody = responseMessage.getBody(Source.class);
+ WebServiceMessage response = messageContext.getResponse();
+ XmlConverter xmlConverter = configuration.getXmlConverter();
+ xmlConverter.toResult(responseBody, response.getPayloadResult());
+ }
+ }
+ }
+
+ private void populateExchangeFromMessageContext(MessageContext messageContext, Exchange exchange) {
+ populateExchangeWithPropertiesFromMessageContext(messageContext, exchange);
+
+ // create inbound message
+ WebServiceMessage request = messageContext.getRequest();
+ SpringWebserviceMessage inMessage = new SpringWebserviceMessage(request);
+ inMessage.setHeaders(extractSoapHeadersFromWebServiceMessage(request));
+ exchange.setIn(inMessage);
+ }
+
+ private void populateExchangeWithPropertiesFromMessageContext(MessageContext messageContext, Exchange exchange) {
+ // convert WebserviceMessage properties (added through interceptors) to
+ // Camel exchange properties
+ String[] propertyNames = messageContext.getPropertyNames();
+ if (propertyNames != null) {
+ for (String propertyName : propertyNames) {
+ exchange.setProperty(propertyName, messageContext.getProperty(propertyName));
+ }
+ }
+ }
+
+ private Map<String, Object> extractSoapHeadersFromWebServiceMessage(WebServiceMessage request) {
+ Map<String, Object> headers = new HashMap<String, Object>();
+ if (request instanceof SoapMessage) {
+ SoapMessage soapMessage = (SoapMessage) request;
+ SoapHeader soapHeader = soapMessage.getSoapHeader();
+ if (soapHeader != null) {
+ Iterator<?> attibutesIterator = soapHeader.getAllAttributes();
+ while (attibutesIterator.hasNext()) {
+ QName name = (QName) attibutesIterator.next();
+ headers.put(name.toString(), soapHeader.getAttributeValue(name));
+ }
+ Iterator<?> elementIter = soapHeader.examineAllHeaderElements();
+ while (elementIter.hasNext()) {
+ Object element = elementIter.next();
+ if (element instanceof SoapHeaderElement) {
+ QName name = ((SoapHeaderElement) element).getName();
+ headers.put(name.toString(), element);
+ }
+ }
+ }
+ }
+ return headers;
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ if (configuration.getEndpointMapping() != null) {
+ configuration.getEndpointMapping().removeConsumer(configuration.getEndpointMappingKey());
+ }
+ super.doStop();
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ if (configuration.getEndpointMapping() != null) {
+ configuration.getEndpointMapping().addConsumer(configuration.getEndpointMappingKey(), this);
+ }
+ super.doStart();
+ }
+
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConsumer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceEndpoint.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceEndpoint.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceEndpoint.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws;
+
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultEndpoint;
+
+public class SpringWebserviceEndpoint extends DefaultEndpoint {
+
+ private SpringWebserviceConfiguration configuration;
+
+ public SpringWebserviceEndpoint(Component component, SpringWebserviceConfiguration configuration) {
+ super(configuration.getEndpointUri(), component);
+ this.configuration = configuration;
+ }
+
+ public Consumer createConsumer(Processor processor) throws Exception {
+ SpringWebserviceConsumer consumer = new SpringWebserviceConsumer(this, processor);
+ if (configuration.getEndpointDispatcher() != null) {
+ configuration.getEndpointDispatcher().setConsumerMessageEndpoint(consumer);
+ }
+ return consumer;
+ }
+
+ public Producer createProducer() throws Exception {
+ return new SpringWebserviceProducer(this);
+ }
+
+ public boolean isSingleton() {
+ return true;
+ }
+
+ public SpringWebserviceConfiguration getConfiguration() {
+ return configuration;
+ }
+
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceEndpoint.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceMessage.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceMessage.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceMessage.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceMessage.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws;
+
+import org.apache.camel.impl.DefaultMessage;
+import org.springframework.ws.WebServiceMessage;
+
+public class SpringWebserviceMessage extends DefaultMessage {
+ private WebServiceMessage webServiceMessage;
+
+ public SpringWebserviceMessage(WebServiceMessage webServiceMessage) {
+ super();
+ this.webServiceMessage = webServiceMessage;
+ }
+
+ @Override
+ protected Object createBody() {
+ if (webServiceMessage != null) {
+ return webServiceMessage.getPayloadSource();
+ }
+ return null;
+ }
+
+ public WebServiceMessage getWebServiceMessage() {
+ return webServiceMessage;
+ }
+
+ public void setWebServiceMessage(WebServiceMessage webServiceMessage) {
+ this.webServiceMessage = webServiceMessage;
+ }
+
+ @Override
+ public String toString() {
+ return "SpringWebserviceMessage[" + webServiceMessage + "]";
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceMessage.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws;
+
+import java.io.IOException;
+import java.net.URI;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.TypeConverter;
+import org.apache.camel.impl.DefaultProducer;
+import org.springframework.ws.WebServiceMessage;
+import org.springframework.ws.client.core.SourceExtractor;
+import org.springframework.ws.client.core.WebServiceMessageCallback;
+import org.springframework.ws.soap.addressing.client.ActionCallback;
+import org.springframework.ws.soap.client.core.SoapActionCallback;
+
+public class SpringWebserviceProducer extends DefaultProducer {
+
+ private static final SourceExtractor SOURCE_EXTRACTOR = new NoopSourceExtractor();
+ private SpringWebserviceEndpoint endpoint;
+
+ public SpringWebserviceProducer(Endpoint endpoint) {
+ super(endpoint);
+ this.endpoint = (SpringWebserviceEndpoint) endpoint;
+ }
+
+ public void process(Exchange exchange) throws Exception {
+ // Let Camel TypeConverter hierarchy handle the conversion of XML messages to Source objects
+ Source sourcePayload = exchange.getIn().getMandatoryBody(Source.class);
+
+ // Extract optional headers
+ String endpointUri = exchange.getIn().getHeader(SpringWebserviceConstants.SPRING_WS_ENDPOINT_URI, String.class);
+ String soapAction = exchange.getIn().getHeader(SpringWebserviceConstants.SPRING_WS_SOAP_ACTION, String.class);
+ URI wsAddressingAction = exchange.getIn().getHeader(SpringWebserviceConstants.SPRING_WS_ADDRESSING_ACTION, URI.class);
+
+ WebServiceMessageCallback callback = new DefaultWebserviceMessageCallback(soapAction, wsAddressingAction);
+ Object body = null;
+ if (endpointUri != null) {
+ body = endpoint.getConfiguration().getWebServiceTemplate().sendSourceAndReceive(endpointUri, sourcePayload, callback, SOURCE_EXTRACTOR);
+ } else {
+ body = endpoint.getConfiguration().getWebServiceTemplate().sendSourceAndReceive(sourcePayload, callback, SOURCE_EXTRACTOR);
+ }
+ exchange.getOut().setBody(body);
+ }
+
+ protected class DefaultWebserviceMessageCallback implements WebServiceMessageCallback {
+ private String soapActionHeader;
+ private URI wsAddressingActionHeader;
+
+ public DefaultWebserviceMessageCallback(String soapAction, URI wsAddressingAction) {
+ this.soapActionHeader = soapAction;
+ this.wsAddressingActionHeader = wsAddressingAction;
+ }
+
+ public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException {
+ // Add SoapAction to webservice request. Note that exchange header
+ // takes precedence over endpoint option
+ String soapAction = soapActionHeader != null ? soapActionHeader : endpoint.getConfiguration().getSoapAction();
+ if (soapAction != null) {
+ new SoapActionCallback(soapAction).doWithMessage(message);
+ }
+ // Add WS-Addressing Action to webservice request (the WS-Addressing
+ // 'to' header will default to the URL of the connection).
+ // Note that exchange header takes precedence over endpoint option
+ URI wsAddressingAction = wsAddressingActionHeader != null ? wsAddressingActionHeader : endpoint.getConfiguration().getWsAddressingAction();
+ if (wsAddressingAction != null) {
+ new ActionCallback(wsAddressingAction).doWithMessage(message);
+ }
+ }
+ }
+
+ /**
+ * A {@link SourceExtractor} that performs no conversion, instead conversion
+ * is handled by Camel's {@link TypeConverter} hierarchy.
+ */
+ private static class NoopSourceExtractor implements SourceExtractor {
+ public Object extractData(Source source) throws IOException, TransformerException {
+ return source;
+ }
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceProducer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointDispatcher.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointDispatcher.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointDispatcher.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointDispatcher.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws.bean;
+
+import org.springframework.util.Assert;
+import org.springframework.ws.context.MessageContext;
+import org.springframework.ws.server.endpoint.MessageEndpoint;
+import org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpointMapping;
+
+/**
+ * Spring {@link MessageEndpoint} for dispatching messages received by Spring-WS to a Camel
+ * endpoint. This class needs to be registered in the Spring <tt>ApplicationContext</tt>
+ * when consuming messages using the <tt>spring-ws:beanname:</tt> URI scheme.
+ * <p/>
+ * For example, when using a route such as <tt>from("spring-ws:beanname:stockQuote").to("...");</tt>
+ * the following bean definition needs to be present in the <tt>ApplicationContext</tt>:
+ * <p/>
+ * {@code
+ * <bean id="stockQuote" class="org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher" />
+ * }
+ *
+ * @see AbstractMapBasedEndpointMapping#setMappings(java.util.Properties)
+ * @see AbstractMapBasedEndpointMapping#setEndpointMap(java.util.Map)
+ */
+public class CamelEndpointDispatcher implements MessageEndpoint {
+
+ private MessageEndpoint consumerMessageEndpoint;
+
+ public void invoke(MessageContext messageContext) throws Exception {
+ Assert.notNull(consumerMessageEndpoint);
+ consumerMessageEndpoint.invoke(messageContext);
+ }
+
+ public MessageEndpoint getConsumerMessageEndpoint() {
+ return consumerMessageEndpoint;
+ }
+
+ public void setConsumerMessageEndpoint(MessageEndpoint consumer) {
+ this.consumerMessageEndpoint = consumer;
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointDispatcher.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointDispatcher.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointMapping.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointMapping.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointMapping.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointMapping.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,209 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws.bean;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.spring.ws.type.EndpointMappingKey;
+import org.apache.camel.component.spring.ws.type.EndpointMappingType;
+import org.apache.camel.converter.jaxp.XmlConverter;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.util.StringUtils;
+import org.springframework.ws.context.MessageContext;
+import org.springframework.ws.server.EndpointInterceptor;
+import org.springframework.ws.server.EndpointInvocationChain;
+import org.springframework.ws.server.EndpointMapping;
+import org.springframework.ws.server.endpoint.MessageEndpoint;
+import org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping;
+import org.springframework.ws.server.endpoint.support.PayloadRootUtils;
+import org.springframework.ws.soap.SoapMessage;
+import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
+import org.springframework.ws.transport.WebServiceConnection;
+import org.springframework.ws.transport.context.TransportContext;
+import org.springframework.ws.transport.context.TransportContextHolder;
+import org.springframework.xml.xpath.XPathExpression;
+
+/**
+ * Spring {@link EndpointMapping} for mapping messages to corresponding Camel endpoints.
+ * This class needs to be registered in the Spring <tt>ApplicationContext</tt> when
+ * consuming messages using any of the following URI schemes:
+ * <p/>
+ * <ul>
+ * <li><tt>spring-ws:rootqname:</tt><br/>
+ * Equivalent to endpoint mappings specified through {@link org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping}
+ * <p/>
+ * <li><tt>spring-ws:soapaction:</tt><br/>
+ * Equivalent to endpoint mappings specified through {@link org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping}
+ * <p/>
+ * <li><tt>spring-ws:uri:</tt><br/>
+ * Equivalent to endpoint mappings specified through {@link org.springframework.ws.server.endpoint.mapping.UriEndpointMapping}
+ * <p/>
+ * <li><tt>spring-ws:xpathresult:</tt><br/>
+ * Equivalent to endpoint mappings specified through {@link org.springframework.ws.server.endpoint.mapping.XPathPayloadEndpointMapping}
+ * </ul>
+ *
+ * @see org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
+ * @see org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping
+ * @see org.springframework.ws.server.endpoint.mapping.UriEndpointMapping
+ * @see org.springframework.ws.server.endpoint.mapping.XPathPayloadEndpointMapping
+ * @see org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping
+ */
+public class CamelEndpointMapping extends AbstractEndpointMapping implements InitializingBean {
+
+ private static final String DOUBLE_QUOTE = "\"";
+ private Map<EndpointMappingKey, MessageEndpoint> endpoints = new ConcurrentHashMap<EndpointMappingKey, MessageEndpoint>();
+ private TransformerFactory transformerFactory;
+ private XmlConverter xmlConverter;
+
+ @Override
+ protected Object getEndpointInternal(MessageContext messageContext) throws Exception {
+ for (EndpointMappingKey key : endpoints.keySet()) {
+ Object messageKey = null;
+ switch (key.getType()) {
+ case ROOT_QNAME:
+ messageKey = getRootQName(messageContext);
+ break;
+ case SOAP_ACTION:
+ messageKey = getSoapAction(messageContext);
+ break;
+ case XPATHRESULT:
+ messageKey = getXPathResult(messageContext, key.getExpression());
+ break;
+ case URI:
+ messageKey = getUri();
+ break;
+ default:
+ throw new RuntimeCamelException("Invalid mapping type specified. Supported types are: root QName, SOAP action, XPath expression and URI");
+ }
+ if (messageKey != null && key.getLookupKey().equals(messageKey)) {
+ return endpoints.get(key);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext, Object endpoint, EndpointInterceptor[] interceptors) {
+ for (EndpointMappingKey key : endpoints.keySet()) {
+ if (EndpointMappingType.SOAP_ACTION.equals(key.getType())) {
+ Object messageKey = getSoapAction(messageContext);
+ if (messageKey != null && key.getLookupKey().equals(messageKey)) {
+ return new SoapEndpointInvocationChain(endpoint, interceptors);
+ // possibly add support for SOAP actors/roles and ultimate
+ // receiver in the future
+ }
+ }
+ }
+ return super.createEndpointInvocationChain(messageContext, endpoint, interceptors);
+ }
+
+ private String getSoapAction(MessageContext messageContext) {
+ if (messageContext.getRequest() instanceof SoapMessage) {
+ SoapMessage request = (SoapMessage) messageContext.getRequest();
+ String soapAction = request.getSoapAction();
+ if (StringUtils.hasLength(soapAction) && soapAction.startsWith(DOUBLE_QUOTE) && soapAction.endsWith(DOUBLE_QUOTE)) {
+ return soapAction.substring(1, soapAction.length() - 1);
+ }
+ return soapAction;
+ }
+ return null;
+ }
+
+ private String getUri() throws URISyntaxException {
+ TransportContext transportContext = TransportContextHolder.getTransportContext();
+ if (transportContext != null) {
+ WebServiceConnection webServiceConnection = transportContext.getConnection();
+ if (webServiceConnection != null) {
+ return webServiceConnection.getUri().toString();
+ }
+ }
+ return null;
+ }
+
+ private String getRootQName(MessageContext messageContext) throws TransformerException, XMLStreamException {
+ QName qName = PayloadRootUtils.getPayloadRootQName(messageContext.getRequest().getPayloadSource(), transformerFactory);
+ return qName != null ? qName.toString() : null;
+ }
+
+ private String getXPathResult(MessageContext messageContext, XPathExpression expression) throws TransformerException, XMLStreamException, ParserConfigurationException, IOException, SAXException {
+ if (expression != null) {
+ Node domNode = xmlConverter.toDOMNode(messageContext.getRequest().getPayloadSource());
+ if (domNode != null) {
+ return expression.evaluateAsString(domNode.getFirstChild());
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Used by Camel Spring Web Services endpoint to register consumers
+ *
+ * @param key unique consumer key
+ * @param endpoint consumer
+ */
+ public void addConsumer(EndpointMappingKey key, MessageEndpoint endpoint) {
+ endpoints.put(key, endpoint);
+ }
+
+ /**
+ * Used by Camel Spring Web Services endpoint to unregister consumers
+ *
+ * @param key unique consumer key
+ */
+ public void removeConsumer(Object key) {
+ endpoints.remove(key);
+ }
+
+ /**
+ * Gets the configured TransformerFactory
+ *
+ * @return instance of TransformerFactory
+ */
+ public TransformerFactory getTransformerFactory() {
+ return transformerFactory;
+ }
+
+ /**
+ * Optional setter to override default TransformerFactory
+ *
+ * @param transformerFactory non-default TransformerFactory
+ */
+ public void setTransformerFactory(TransformerFactory transformerFactory) {
+ this.transformerFactory = transformerFactory;
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ xmlConverter = new XmlConverter();
+ if (transformerFactory != null) {
+ xmlConverter.setTransformerFactory(transformerFactory);
+ } else {
+ transformerFactory = TransformerFactory.newInstance();
+ }
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointMapping.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/bean/CamelEndpointMapping.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/StringSourceConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/StringSourceConverter.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/StringSourceConverter.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/StringSourceConverter.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws.converter;
+
+import org.apache.camel.Converter;
+
+/**
+ * A helper class to transform to and from {@link org.springframework.xml.transform.StringSource} implementations
+ * available in both Camel and Spring Webservices.
+ * <p/>
+ * Rationale: most of the time this converter will not be used since both Camel
+ * and Spring-WS use the {@Source} interface abstraction. There is
+ * however a chance that you may end up with incompatible {@link org.springframework.xml.transform.StringSource}
+ * implementations, this converter handles these (corner)cases.
+ * <p/>
+ * Note that conversion options are limited by Spring's {@link org.springframework.xml.transform.StringSource}
+ * since it's the most simple one. It has just one constructor that accepts a
+ * String as input.
+ */
+@Converter
+public final class StringSourceConverter {
+
+ private StringSourceConverter() {
+ }
+
+ /**
+ * Converts a Spring-WS {@link org.springframework.xml.transform.StringSource}
+ * to a Camel {@link org.apache.camel.converter.jaxp.StringSource}
+ */
+ @Converter
+ public static org.apache.camel.converter.jaxp.StringSource toStringSourceFromSpring(org.springframework.xml.transform.StringSource springStringSource) {
+ return new org.apache.camel.converter.jaxp.StringSource(springStringSource.toString());
+ }
+
+ /**
+ * Converts a Camel {@link org.apache.camel.converter.jaxp.StringSource}
+ * to a Spring-WS {@link org.springframework.xml.transform.StringSource}
+ */
+ @Converter
+ public static org.springframework.xml.transform.StringSource toStringSourceFromCamel(org.apache.camel.converter.jaxp.StringSource camelStringSource) {
+ return new org.springframework.xml.transform.StringSource(camelStringSource.getText());
+ }
+}
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/StringSourceConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/converter/StringSourceConverter.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingKey.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingKey.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingKey.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingKey.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,88 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws.type;
+
+import org.springframework.xml.xpath.XPathExpression;
+
+public class EndpointMappingKey {
+ private EndpointMappingType type;
+ private String lookupKey;
+
+ /* expression in case type is 'xpath' */
+ private XPathExpression expression;
+
+ public EndpointMappingKey(EndpointMappingType type, String lookupKey, XPathExpression expression) {
+ this.type = type;
+ this.lookupKey = lookupKey;
+ this.expression = expression;
+ }
+
+ public EndpointMappingType getType() {
+ return type;
+ }
+
+ public void setType(EndpointMappingType type) {
+ this.type = type;
+ }
+
+ public String getLookupKey() {
+ return lookupKey;
+ }
+
+ public void setLookupKey(String lookupKey) {
+ this.lookupKey = lookupKey;
+ }
+
+ public XPathExpression getExpression() {
+ return expression;
+ }
+
+ public void setExpression(XPathExpression expression) {
+ this.expression = expression;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((lookupKey == null) ? 0 : lookupKey.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+
+ EndpointMappingKey other = (EndpointMappingKey) obj;
+ if (lookupKey == null) {
+ if (other.lookupKey != null) {
+ return false;
+ }
+ } else if (!lookupKey.equals(other.lookupKey)) {
+ return false;
+ }
+ return true;
+ }
+}
\ No newline at end of file
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingKey.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingKey.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingType.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingType.java?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingType.java (added)
+++ camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingType.java Fri Nov 5 05:56:45 2010
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.camel.component.spring.ws.type;
+
+/**
+ * Endpoint mappings supported by consumer through uri configuration.
+ */
+public enum EndpointMappingType {
+ ROOT_QNAME("rootqname:"),
+ SOAP_ACTION("soapaction:"),
+ XPATHRESULT("xpathresult:"),
+ URI("uri:"),
+ BEANNAME("beanname:");
+
+ private String prefix;
+
+ private EndpointMappingType(String prefix) {
+ this.prefix = prefix;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ /**
+ * Find {@link EndpointMappingType} that corresponds with the prefix of the
+ * given uri. Matching of uri prefix against enum values is case-insensitive
+ *
+ * @param uri remaining uri part of Spring-WS component
+ * @return EndpointMappingType corresponding to uri prefix
+ */
+ public static EndpointMappingType getTypeFromUriPrefix(String uri) {
+ if (uri != null) {
+ for (EndpointMappingType type : EndpointMappingType.values()) {
+ if (uri.toLowerCase().startsWith(type.getPrefix())) {
+ return type;
+ }
+ }
+ }
+ return null;
+ }
+}
\ No newline at end of file
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/type/EndpointMappingType.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/LICENSE.txt
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/LICENSE.txt?rev=1031442&view=auto
==============================================================================
--- camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/LICENSE.txt (added)
+++ camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/LICENSE.txt Fri Nov 5 05:56:45 2010
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
Propchange: camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/LICENSE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-spring-ws/src/main/resources/META-INF/LICENSE.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain