[CONF] Apache Camel Spring Web Services

2013-05-09 Thread confluence







Spring Web Services
Page edited by Babak Vahdat


 Changes (3)
 




...
| {{wsAddressingAction}} | No | WS-Addressing 1.0 action header to include when accessing web services. The {{To}} header is set to the _address_ of the web service as specified in the endpoint URI (default Spring-WS behavior). | | {{_expression_}} | Only when _mapping-type_ is {{xpathresult}} | XPath _expression_ to use in the process of mapping web service requests, should match the result specified by {{xpathresult}} | 
*Camel 2.12:*nbsp;The built-in message sendernbsp;_HttpComponentsMessageSender_nbsp;is considered *instead of*nbsp;_CommonsHttpMessageSender_nbsp;which has been deprecated, see [HttpComponentsMessageSender.setReadTimeout()|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/HttpComponentsMessageSender.html#setReadTimeout(int)]. | 
| {{timeout}} | No | *Camel 2.10:* Sets the socket read timeout (in milliseconds) while invoking a webservice using the producer, see [URLConnection.setReadTimeout()|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setReadTimeout(int)] and [CommonsHttpMessageSender.setReadTimeout()|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/CommonsHttpMessageSender.html#setReadTimeout(int)]. nbsp;This option works when using the built-in message sender implementations:nbsp;_CommonsHttpMessageSender_nbsp;andnbsp;_HttpUrlConnectionMessageSender_. nbsp;One of these implementations will be used by default for HTTP based services unless you customize the Spring WS configuration options supplied to the component. nbsp;If you are using a non-standard sender, it is assumed that you will handle your own timeout configuration.\\
| {{sslContextParameters}} | No | *Camel 2.10:*nbsp;Reference to annbsp;{{org.apache.camel.util.jsse.SSLContextParameters}} innbsp;thenbsp;[Registry|http://camel.apache.org/registry.html]. nbsp;Seenbsp;[Using the JSSE Configuration Utility|http://camel.apache.org/http4.html#HTTP4-UsingtheJSSEConfigurationUtility]. nbsp;This option works when using the built-in message sender implementations:nbsp;_CommonsHttpMessageSender_nbsp;andnbsp;_HttpUrlConnectionMessageSender_. nbsp;One of these implementations will be used by default for HTTP based services unless you customize the Spring WS configuration options supplied to the component. nbsp;If you are using a non-standard sender, it is assumed that you will handle your own TLS configuration.\\ 
*Camel 2.12:*nbsp;The built-in message sendernbsp;_HttpComponentsMessageSender_nbsp;is considered *instead of*nbsp;_CommonsHttpMessageSender_nbsp;which has been deprecated. | 
{div}  
...
Spring configuration: {code:xml}!-- authenticate using HTTP Basic Authentication -- 
bean id=messageSender class=org.springframework.ws.transport.http.CommonsHttpMessageSender class=org.springframework.ws.transport.http.HttpComponentsMessageSender 
	property name=credentials 		bean class=org.apache.commons.httpclient.UsernamePasswordCredentials 
...


Full Content

Spring Web Services Component

Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both clientside support, for accessing web services, and serverside support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x.

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 

[CONF] Apache Camel Spring Web Services

2013-04-27 Thread confluence







Spring Web Services
Page edited by Claus Ibsen


 Changes (2)
 




...
| {{CamelSpringWebserviceSoapAction}} | String | Header to specify the SOAP action of the message, overrides {{soapAction}} option if present | | {{CamelSpringWebserviceAddressingAction}} | URI | Use this header to specify the WS-Addressing action of the message, overrides {{wsAddressingAction}} option if present | 
| {{CamelSpringWebserviceSoapHeader}} | Source | *Camel 2.11.1:* Use this header to specify/access the SOAP headers of the message. | 
{div}  
...
{code}  
 h3. Using SOAP headers *Available as of Camel 2.11.1*  You can provide the SOAP header(s) as a Camel Message header when sending a message to a spring-ws endpoint, for example given the following SOAP header in a String {code} String body = ... String soapHeader = h:Header xmlns:h=\http://www.webserviceX.NET/\h:MessageID1234567890/h:MessageIDh:Nestedh:NestedID/h:NestedID/h:Nested/h:Header; {code}  We can set the body and header on the Camel Message as follows: {code} exchange.getIn().setBody(body); exchange.getIn().setHeader(SpringWebserviceConstants.SPRING_WS_SOAP_HEADER, soapHeader); {code}  And then send the Exchange to a {{spring-ws}} endpoint to call the Web Service.  Likewise the spring-ws consumer will also enrich the Camel Message with the SOAP header.  For an example see this [unit test|https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/SoapHeaderTest.java].   
h3. The header and attachment propagation Spring WS Camel supports propagation of the headers and attachments into Spring-WS WebServiceMessage response since version *2.10.3*. 
...


Full Content

Spring Web Services Component

Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both clientside support, for accessing web services, and serverside support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x.

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference an org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher object in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 


 timeout 
 No 
 Camel 2.10: Sets the socket 

[CONF] Apache Camel Spring Web Services

2012-12-22 Thread confluence







Spring Web Services
Page edited by willem jiang


Comment:
CAMEL-5724


 Changes (2)
 




...
| {{transformerFactory}} | No | Option to override default TransformerFactory. The provided transformer factory must be of type {{javax.xml.transform.TransformerFactory}} | | {{endpointMapping}} | Only when _mapping-type_ is {{rootqname}}, {{soapaction}}, {{uri}} or {{xpathresult}} | Reference to an instance of {{org.apache.camel.component.spring.ws.bean.CamelEndpointMapping}} in the Registry/ApplicationContext. Only one bean is required in the registry to serve all Camel/Spring-WS endpoints. This bean is auto-discovered by the [MessageDispatcher|http://static.springsource.org/spring-ws/sites/1.5/apidocs/org/springframework/ws/server/MessageDispatcher.html] and used to map requests to Camel endpoints based on characteristics specified on the endpoint (like root QName, SOAP action, etc) | 
| {{messageFilter}} | No | Option to provide a custom MessageFilter since 2.10.3. For example when you want to process your headers or attachments by your own. |  
{div}  
...
{code}  
h3. The header and attachment propagation Spring WS Camel supports propagation of the headers and attachments into Spring-WS WebServiceMessage response since version *2.10.3*. The endpoint will use so called hook the MessageFilter (default implementation is provided by BasicMessageFilter) to propagate the exchange headers and attachments into WebSdrviceMessage response. Now you can use  {code} exchange.getOut().getHeaders().put(myCustom,myHeaderValue) exchange.getIn().addAttachment(myAttachment, new DataHandler(...)) {code} Note: If the exchange header in the pipeline contains text, it generates Qname(key)=value attribute in the soap header.  Recommended is to create a QName class directly and put into any key into header.  h3. How to use MTOM attachments The BasicMessageFilter provides all required information for Apache Axiom in order to produce MTOM message. If you want to use Apache Camel Spring WS within Apache Axiom, here is an example: 1. Simply define the messageFactory as is bellow and spring-ws will use MTOM strategy to populate your SOAP message with optimized attachments. {code} bean id=axiomMessageFactory class=org.springframework.ws.soap.axiom.AxiomSoapMessageFactory property name=payloadCaching value=false / property name=attachmentCaching value=true / property name=attachmentCacheThreshold value=1024 / /bean {code}  2. Add into your pom.xml the following dependencies {code} dependency groupIdorg.apache.ws.commons.axiom/groupId artifactIdaxiom-api/artifactId version1.2.13/version /dependency dependency groupIdorg.apache.ws.commons.axiom/groupId artifactIdaxiom-impl/artifactId version1.2.13/version scoperuntime/scope /dependency {code} 3. Add your attachment into the pipeline, for example using a Processor implementation. {code} private class Attachement implements Processor { public void process(Exchange exchange) throws Exception { exchange.getOut().copyFrom(exchange.getIn()); File file = new File(testAttachment.txt); exchange.getOut().addAttachment(test, new DataHandler(new FileDataSource(file)));	 } } {code} 4. Define endpoint (producer) as ussual, for example like this: {code} from(direct:send) .process(new Attachement()) .to(spring-ws:http://localhost:8089/mySoapService?soapAction=mySoapmessageFactory=axiomMessageFactory); {code} 5. Now, your producer will generate MTOM message with otpmized attachments.  h3. The custom header and attachment filtering If you need to provide your custome processing of either headers or attachments, extend existing BasicMessageFilter and override the approchiate methods or write a brand new implementation of the MessageFilter interface. To use your custom filter, add this into your spring context: You can specify either a global a or a local message filter as follows: a) the global custome filter that provides the global configuration for all spring-ws endpoints {code}  bean id=messageFilter class=your.domain.myMessageFiler scope=singleton / {code} or b) the local messageFilter directly on the endpoint as follows: {code} to(spring-ws:http://yourdomain.com?messageFilter=#myEndpointSpecificMessageFilter); {code} For more information see [CAMEL-5724|https://issues.apache.org/jira/browse/CAMEL-5724]  If you want to create your own MessageFilter, consider overrideing the following methods in the default implementation of MessageFilter in class BasicMessageFilter: {code} protected void doProcessSoapHeader(Message inOrOut, SoapMessage soapMessage) {your code /*no need to call super*/ } protected void doProcessSoapAttachements(Message inOrOut, SoapMessage response) { your code /*no need to call super*/ } {code}  
h3. Using a custom MessageSender and 

[CONF] Apache Camel Spring Web Services

2012-06-21 Thread confluence







Spring Web Services
Page edited by David Valeri


 Changes (1)
 




...
| {{wsAddressingAction}} | No | WS-Addressing 1.0 action header to include when accessing web services. The {{To}} header is set to the _address_ of the web service as specified in the endpoint URI (default Spring-WS behavior). | | {{_expression_}} | Only when _mapping-type_ is {{xpathresult}} | XPath _expression_ to use in the process of mapping web service requests, should match the result specified by {{xpathresult}} | 
| {{timeout}} | No | *Camel 2.10:* Sets the socket read timeout (in milliseconds) while invoking a webservice using the producer, see [URLConnection.setReadTimeout()|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setReadTimeout(int)] and [CommonsHttpMessageSender.setReadTimeout()|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/CommonsHttpMessageSender.html#setReadTimeout(int)]. nbsp;This option works when using the built-in message sender implementations:nbsp;_CommonsHttpMessageSender_nbsp;andnbsp;_HttpUrlConnectionMessageSender_. nbsp;One of these implementations will be used by default for HTTP based services unless you customize the Spring WS configuration options supplied to the component. nbsp;If you are using a non-standard sender, it is assumed that you will handle your own timeout configuration. | 
| {{sslContextParameters}} | No | *Camel 2.10:*nbsp;Reference to annbsp;{{org.apache.camel.util.jsse.SSLContextParameters}} innbsp;thenbsp;[Registry|http://camel.apache.org/registry.html]. nbsp;Seenbsp;[Using the JSSE Configuration Utility|http://camel.apache.org/http4.html#HTTP4-UsingtheJSSEConfigurationUtility]. nbsp;This option works when using the built-in message sender implementations:nbsp;_CommonsHttpMessageSender_nbsp;andnbsp;_HttpUrlConnectionMessageSender_. nbsp;One of these implementations will be used by default for HTTP based services unless you customize the Spring WS configuration options supplied to the component. nbsp;If you are using a non-standard sender, it is assumed that you will handle your own TLS configuration. | {div} 
...


Full Content

Spring Web Services Component

Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both clientside support, for accessing web services, and serverside support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x.

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows


spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference an org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher object in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 

[CONF] Apache Camel Spring Web Services

2012-04-16 Thread confluence







Spring Web Services
Page edited by David Valeri


 Changes (6)
 




...
*Available as of Camel 2.6*  
The *spring-ws:* component allows you to integrate with [Spring Web Services|http://static.springsource.org/spring-ws/sites/1.5/]. It offers both _client_\-side support, for accessing web services, and _server_\-side support for creating your own contract-first web services. 
 Maven users will need to add the following dependency to their {{pom.xml}} for this component: 
...
| {{_expression_}} | Only when _mapping-type_ is {{xpathresult}} | XPath _expression_ to use in the process of mapping web service requests, should match the result specified by {{xpathresult}} | | {{timeout}} | No | *Camel 2.10:* Sets the socket read timeout (in milliseconds) while invoking a webservice using the producer, see [URLConnection.setReadTimeout()|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setReadTimeout(int)] and [CommonsHttpMessageSender.setReadTimeout()|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/CommonsHttpMessageSender.html#setReadTimeout(int)] | 
| {{sslContextParameters}} | No | *Camel 2.10:*nbsp;Reference to anbsp;{{org.apache.camel.util.jsse.SSLContextParameters}}nbsp;in thenbsp;[Registry|http://camel.apache.org/registry.html]. nbsp;Seenbsp;[Using the JSSE Configuration Utility|http://camel.apache.org/http4.html#HTTP4-UsingtheJSSEConfigurationUtility]. nbsp;This option works when using the built-in message sender implementations:nbsp;_CommonsHttpMessageSender_nbsp;andnbsp;_HttpUrlConnectionMessageSender_. nbsp;One of these implementations will be used by default for HTTP based services unless you customize the Spring WS configuration options supplied to the component. nbsp;If you are using a non-standard sender, it is assumed that you will handle your own TLS configuration. | 
{div}  
...
h2. Accessing web services  
To call a web service at {{[http://foo.com/bar]}} simply define a route: 
{code} from(direct:example).to(spring-ws:http://foo.com/bar) 
...
With the XML configuration in-place you can now use Camels DSL to define what web service requests are handled by your endpoint:  
The following route will receive all web service requests that have a root element named GetFoo within the {{[http://example.com/]}} namespace. 
{code} from(spring-ws:rootqname:{http://example.com/}GetFoo?endpointMapping=#endpointMapping) 
...
{code}  
The following route will receive web service requests containing the {{[http://example.com/GetFoo]}} SOAP action. 
{code} from(spring-ws:soapaction:http://example.com/GetFoo?endpointMapping=#endpointMapping) 
...
{code}  
The following route will receive all requests sent to {{[http://example.com/foobar]}}. 
{code} from(spring-ws:uri:http://example.com/foobar?endpointMapping=#endpointMapping) 
...


Full Content

Spring Web Services Component

Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both clientside support, for accessing web services, and serverside support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:


dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x.

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows


spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service 

[CONF] Apache Camel Spring Web Services

2012-02-11 Thread confluence







Spring Web Services
Page edited by Babak Vahdat


 Changes (1)
 




...
| {{wsAddressingAction}} | No | WS-Addressing 1.0 action header to include when accessing web services. The {{To}} header is set to the _address_ of the web service as specified in the endpoint URI (default Spring-WS behavior). | | {{_expression_}} | Only when _mapping-type_ is {{xpathresult}} | XPath _expression_ to use in the process of mapping web service requests, should match the result specified by {{xpathresult}} | 
| {{timeout}} | No | *Camel 2.10:* Sets the socket read timeout (in milliseconds) while invoking a webservice using the producer, see [URLConnection|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setReadTimeout%28int%29] [URLConnection.setReadTimeout()|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setReadTimeout(int)] and [CommonsHttpMessageSender|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/CommonsHttpMessageSender.html#setReadTimeout%28int%29] [CommonsHttpMessageSender.setReadTimeout()|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/CommonsHttpMessageSender.html#setReadTimeout(int)] | 
{div}  
...


Full Content

Spring Web Services Component
Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x. 

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference a org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 


 timeout 
 No 
 Camel 2.10: Sets the socket read timeout (in milliseconds) while invoking a webservice using the producer, see URLConnection.setReadTimeout() and CommonsHttpMessageSender.setReadTimeout() 





Registry based options

The following options can be specified in the registry (most likely a Spring ApplicationContext) and referenced from the endpoint URI using the # notation.




 Name 
 Required? 
 Description 


 webServiceTemplate 
 No 
 Option to provide a custom WebServiceTemplate. This allows for full control over  

[CONF] Apache Camel Spring Web Services

2012-02-09 Thread confluence







Spring Web Services
Page edited by Babak Vahdat


 Changes (1)
 




...
| {{wsAddressingAction}} | No | WS-Addressing 1.0 action header to include when accessing web services. The {{To}} header is set to the _address_ of the web service as specified in the endpoint URI (default Spring-WS behavior). | | {{_expression_}} | Only when _mapping-type_ is {{xpathresult}} | XPath _expression_ to use in the process of mapping web service requests, should match the result specified by {{xpathresult}} | 
| {{timeout}} | No | *Camel 2.10:* Sets the socket read timeout while invoking a webservice using the producer, see [URLConnection|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setReadTimeout%28int%29] and [CommonsHttpMessageSender|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/CommonsHttpMessageSender.html#setReadTimeout%28int%29] | 
{div}  
...


Full Content

Spring Web Services Component
Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x. 

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference a org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 


 timeout 
 No 
 Camel 2.10: Sets the socket read timeout while invoking a webservice using the producer, see URLConnection and CommonsHttpMessageSender 





Registry based options

The following options can be specified in the registry (most likely a Spring ApplicationContext) and referenced from the endpoint URI using the # notation.




 Name 
 Required? 
 Description 


 webServiceTemplate 
 No 
 Option to provide a custom WebServiceTemplate. This allows for full control over  client-side web services handling; like adding a custom interceptor or specifying a fault resolver, message sender or message factory. 


 messageSender 
 No 
 Option to provide a custom WebServiceMessageSender. For example to perform authentication or use alternative transports 


 messageFactory 
 No 
 Option to provide a custom WebServiceMessageFactory. For example when you want 

[CONF] Apache Camel Spring Web Services

2012-02-09 Thread confluence







Spring Web Services
Page edited by Babak Vahdat


 Changes (1)
 




...
| {{wsAddressingAction}} | No | WS-Addressing 1.0 action header to include when accessing web services. The {{To}} header is set to the _address_ of the web service as specified in the endpoint URI (default Spring-WS behavior). | | {{_expression_}} | Only when _mapping-type_ is {{xpathresult}} | XPath _expression_ to use in the process of mapping web service requests, should match the result specified by {{xpathresult}} | 
| {{timeout}} | No | *Camel 2.10:* Sets the socket read timeout (in milliseconds) while invoking a webservice using the producer, see [URLConnection|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setReadTimeout%28int%29] and [CommonsHttpMessageSender|http://static.springsource.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/CommonsHttpMessageSender.html#setReadTimeout%28int%29] | 
{div}  
...


Full Content

Spring Web Services Component
Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesAs of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x. 

Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run earlier versions of camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference a org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 


 timeout 
 No 
 Camel 2.10: Sets the socket read timeout (in milliseconds) while invoking a webservice using the producer, see URLConnection and CommonsHttpMessageSender 





Registry based options

The following options can be specified in the registry (most likely a Spring ApplicationContext) and referenced from the endpoint URI using the # notation.




 Name 
 Required? 
 Description 


 webServiceTemplate 
 No 
 Option to provide a custom WebServiceTemplate. This allows for full control over  client-side web services handling; like adding a custom interceptor or specifying a fault resolver, message sender or message factory. 


 messageSender 
 No 
 Option to provide a custom WebServiceMessageSender. For example to perform authentication or use alternative transports 


 messageFactory 
 No 
 Option to provide a custom 

[CONF] Apache Camel Spring Web Services

2011-03-02 Thread confluence







Spring Web Services
Page edited by Christian Mueller


Comment:
Reverted from v. 18


 Changes (3)
 




...
{code}  
{warning:title=running Spring Web Services Component 2.7 in OSGI} Because of issue [SWS-681|https://jira.springsource.org/browse/SWS-681] in Spring-WS, this component cannot be used in an OSGI environment out of the box. When the Spring guys fixed this issue, announced for 2.0.1.RELEASE, you have to update the dependent OSGI bundle org.springframework.ws/spring-ws-core to 2.0.1.RELEASE or newer. {warning} 
{info:title=Dependencies}This component offers support for Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x. In order to run camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x. 
 
In order to run Spring-WS 1.5.9 on Spring 3.0 you need to exclude the OXM module from Spring 3.0 as this module is also included in Spring-WS 1.5.9 (see [this post|http://stackoverflow.com/questions/3313314/can-spring-ws-1-5-be-used-with-spring-3]) {info}  
h3. URI format  
...


Full Content

Spring Web Services Component
Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesThis component offers support for Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x.
In order to run camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x.

In order to run Spring-WS 1.5.9 on Spring 3.0 you need to exclude the OXM module from Spring 3.0 as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference a org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 





Registry based options

The following options can be specified in the registry (most likely a Spring ApplicationContext) and referenced from the endpoint URI using the # notation.




 Name 
 Required? 
 Description 


 webServiceTemplate 
 No 
 Option to provide a custom WebServiceTemplate. This allows for full control over  client-side web services handling; like adding a custom interceptor or specifying a fault resolver, message sender or message factory. 


 messageSender 
 No 
 Option to provide a custom WebServiceMessageSender. For example to perform authentication or use alternative transports 


 messageFactory 
 No 
 Option to provide a custom WebServiceMessageFactory. For example when you want Apache Axiom to handle web service messages instead of SAAJ 


 transformerFactory 
 No 
 Option to 

[CONF] Apache Camel Spring Web Services

2011-01-08 Thread confluence







Spring Web Services
Page edited by Richard Kettelerij


Comment:
CAMEL-3472 add example of Spring Web Services component


 Changes (1)
 



...
{code}  
More information on setting up Spring-WS can be found in [Writing Contract-First Web Services|http://static.springsource.org/spring-ws/sites/1.5/reference/html/tutorial.html]. Basically paragraph 3.6 Implementing the Endpoint is handled by this component (specifically paragraph 3.6.2 Routing the Message to the Endpoint is where {{CamelEndpointMapping}} comes in). Also dont forget to check out the [Spring Web Services Example|spring ws example] included in the Camel distribution. 
 h3. Endpoint mapping in routes 
...

Full Content

Spring Web Services Component
Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesThis component offers support for Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x.
In order to run camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x.

In order to run Spring-WS 1.5.9 on Spring 3.0 you need to exclude the OXM module from Spring 3.0 as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference a org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 





Registry based options

The following options can be specified in the registry (most likely a Spring ApplicationContext) and referenced from the endpoint URI using the # notation.




 Name 
 Required? 
 Description 


 webServiceTemplate 
 No 
 Option to provide a custom WebServiceTemplate. This allows for full control over  client-side web services handling; like adding a custom interceptor or specifying a fault resolver, message sender or message factory. 


 messageSender 
 No 
 Option to provide a custom WebServiceMessageSender. For example to perform authentication or use alternative transports 


 messageFactory 
 No 
 Option to provide a custom WebServiceMessageFactory. For example when you want Apache Axiom to handle web service messages instead of SAAJ 


 transformerFactory 
 No 
 Option to override default TransformerFactory. The provided transformer factory must be of type javax.xml.transform.TransformerFactory 


 endpointMapping 
 Only when mapping-type is rootqname, soapaction, uri or xpathresult 
 Reference to org.apache.camel.component.spring.ws.bean.CamelEndpointMapping in the Registry/ApplicationContext. Only one bean is required in the registry to serve all Camel/Spring-WS endpoints. This bean is 

[CONF] Apache Camel Spring Web Services

2010-11-04 Thread confluence







Spring Web Services
Page edited by Claus Ibsen


 Changes (12)
 



...
*Available as of Camel 2.6*  
The *spring-ws:* component allows you to integrate with [Spring Web Services|http://static.springsource.org/spring-ws/sites/1.5/]. It offers both _client_-side support, for accessing web services, and _server_-side support for creating your own contract-first web services. 
 Maven users will need to add the following dependency to their {{pom.xml}} for this component: 
...
 {code} 
spring-ws:[mapping-type:]address[?options] 
{code}  
...
To call a web service at {{http://foo.com/bar}} simply define a route: {code} 
from(direct:example).to(spring-ws:http://foo.com/bar) 
{code}  
...
{code} from(direct:example) 
.to(spring-ws:http://foo.com/bar?soapAction=http://foo.comwsAddressingAction=http://bar.com) 
{code}  
...
{code} from(direct:example) 
.to(spring-ws:http://foo.com/bar?messageFactory=#messageFactorymessageSender=#messageSender) 
{code}  
...
The following route will receive all web service requests that have a root element named GetFoo within the {{http://example.com/}} namespace. {code} 
from(spring-ws:rootqname:{http://example.com/}GetFoo?endpointMapping=#endpointMapping) 
.convertBodyTo(String.class).to(mock:example) {code} 
...
The following route will receive web service requests containing the {{http://example.com/GetFoo}} SOAP action. {code} 
from(spring-ws:soapaction:http://example.com/GetFoo?endpointMapping=#endpointMapping) 
.convertBodyTo(String.class).to(mock:example) {code} 
...
The following route will receive all requests sent to {{http://example.com/foobar}}. {code} 
from(spring-ws:uri:http://example.com/foobar?endpointMapping=#endpointMapping) 
.convertBodyTo(String.class).to(mock:example) {code} 
...
The route below will receive requests that contain the element {{foobarabc/foobar}} anywhere inside the message (and the default namespace). {code} 
from(spring-ws:xpathresult:abc?_expression_=//foobarendpointMapping=#endpointMapping) 
.convertBodyTo(String.class).to(mock:example) {code} 
...
camelContext xmlns=http://camel.apache.org/schema/spring 	route 
from uri=spring-ws:beanname:QuoteEndpointDispatcher / 
		to uri=mock:example / 	/route 
...
jaxb.setContextPath(com.example.model);  
from(direct:example).marshal(jaxb).to(spring-ws:http://foo.com/bar).unmarshal(jaxb); 
{code}  Similarly when _providing_ web services, you can unmarshal XML requests to POJOs and marshal the response message back to XML: {code} 
from(spring-ws:rootqname:{http://example.com/}GetFoo?endpointMapping=#endpointMapping).unmarshal(jaxb) 
.to(mock:example).marshal(jaxb); {code} 
...

Full Content

Spring Web Services Component
Available as of Camel 2.6

The spring-ws: component allows you to integrate with Spring Web Services. It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesThis component offers support for Spring-WS 1.5.9 which is compatible with Spring 2.5.x and 3.0.x.
In order to run camel-spring-ws on Spring 2.5.x you need to add the spring-webmvc module from Spring 2.5.x.

In order to run Spring-WS 1.5.9 on Spring 3.0 you need to exclude the OXM module from Spring 3.0 as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



spring-ws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the 

[CONF] Apache Camel Spring Web Services

2010-10-27 Thread confluence







Spring Web Services
Page edited by Richard Kettelerij


Comment:
improved docs


 Changes (1)
 



...
{code}  
More information on setting up Spring-WS can be found in [Writing Contract-First Web Services|http://static.springsource.org/spring-ws/sites/1.5/reference/html/tutorial.html]. Basically paragraph 3.6 Implementing the Endpoint is handled by this component (specifically paragraph 3.6.2 Routing the Message to the Endpoint is where {{CamelEndpointMapping}} comes in). 
 h3. Endpoint mapping in routes 
...

Full Content

Spring Web Services Component
Available as of Camel 2.6

The springws: component allows you to integrate with Spring Web Services. It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesThis component offers support for Spring-WS 1.5.9 which is compatible with Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0 you need to exclude the OXM module from Spring 3.0 as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



springws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference a org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a producer the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 





Registry based options

The following options can be specified in the registry (most likely a Spring ApplicationContext) and referenced from the endpoint URI using the # notation.




 Name 
 Required? 
 Description 


 webServiceTemplate 
 No 
 Option to provide a custom WebServiceTemplate. This allows for full control over  client-side web services handling; like adding a custom interceptor or specifying a fault resolver, message sender or message factory. 


 messageSender 
 No 
 Option to provide a custom WebServiceMessageSender. For example to perform authentication or use alternative transports 


 messageFactory 
 No 
 Option to provide a custom WebServiceMessageFactory. For example when you want Apache Axiom to handle web service messages instead of SAAJ 


 transformerFactory 
 No 
 Option to override default TransformerFactory. The provided transformer factory must be of type javax.xml.transform.TransformerFactory 


 endpointMapping 
 Only when mapping-type is rootqname, soapaction, uri or xpathresult 
 Reference to org.apache.camel.component.spring.ws.bean.CamelEndpointMapping in the Registry/ApplicationContext. Only one bean is required in the registry to serve all Camel/Spring-WS endpoints. This bean is auto-discovered by the MessageDispatcher and used to map requests to Camel endpoints based on characteristics specified on the endpoint (like root QName, SOAP action, etc) 





Message headers




 Name 
 Type 
 Description 


 CamelSpringWebserviceEndpointUri 
 String 
 URI of the 

[CONF] Apache Camel Spring Web Services

2010-10-26 Thread confluence







Spring Web Services
Page  added by R. Kettelerij

 

 Spring Web Services Component
Available as of Camel 2.6

The springws: component allows you to integrate with Spring Web Services It offers both client-side support, for accessing web services, and server-side support for creating your own contract-first web services.

Maven users will need to add the following dependency to their pom.xml for this component:



dependency
	groupIdorg.apache.camel/groupId
	artifactIdcamel-spring-ws/artifactId
	versionx.x.x/version
	!-- use the same version as your Camel core version --
/dependency



DependenciesThis component offers support for Spring-WS 1.5.9 which is compatible with Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0 you need to exclude the OXM module from Spring 3.0 as this module is also included in Spring-WS 1.5.9 (see this post)

URI format

The URI scheme for this component is as follows



springws:[mapping-type:]address[?options]



To expose a web service mapping-type needs to be set to any of the following:




 Mapping type 
 Description 


 rootqname 
 Offers the option to map web service requests based on the qualified name of the root element contained in the message. 


 soapaction 
 Used to map web service requests based on the SOAP action specified in the header of the message. 


 uri 
 In order to map web service requests that target a specific URI. 


 xpathresult 
 Used to map web service requests based on the evaluation of an XPath _expression_ against the incoming message. The result of the evaluation should match the XPath result specified in the endpoint URI. 


 beanname 
 Allows you to reference a org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher in order to integrate with existing (legacy) endpoint mappings like PayloadRootQNameEndpointMapping, SoapActionEndpointMapping, etc 





As a consumer the address should contain a value relevant to the specified mapping-type (e.g. a SOAP action, XPath _expression_). As a provider the address should be set to the URI of the web service your calling upon.

You can append query options to the URI in the following format, ?option=valueoption=value...

Options




 Name 
 Required? 
 Description 


 soapAction 
 No 
 SOAP action to include inside a SOAP request when accessing remote web services 


 wsAddressingAction 
 No 
 WS-Addressing 1.0 action header to include when accessing web services. The To header is set to the address of the web service as specified in the endpoint URI (default Spring-WS behavior). 


 _expression_ 
 Only when mapping-type is xpathresult 
 XPath _expression_ to use in the process of mapping web service requests, should match the result specified by xpathresult 





Registry based options

The following options can be specified in the registry (most likely a Spring ApplicationContext) and referenced from the endpoint URI using the # notation.




 Name 
 Required? 
 Description 


 webServiceTemplate 
 No 
 Option to provide a custom WebServiceTemplate. This allows for full control over  client-side web services handling; like adding a custom interceptor or specifying a fault resolver, message sender or message factory. 


 messageSender 
 No 
 Option to provide a custom WebServiceMessageSender. For example to perform authentication or use alternative transports 


 messageFactory 
 No 
 Option to provide a custom WebServiceMessageFactory. For example when you want Apache Axiom to handle web service messages instead of SAAJ 


 transformerFactory 
 No 
 Option to override default TransformerFactory. The provided transformer factory must be of type javax.xml.transform.TransformerFactory 


 endpointMapping 
 Only when mapping-type is rootqname, soapaction, uri or xpathresult 
 Reference to org.apache.camel.component.spring.ws.bean.CamelEndpointMapping in the Registry/ApplicationContext. Only one bean is required in the registry to serve all Camel/Spring-WS endpoints. This bean is auto-discovered by the MessageDispatcher and used to map requests to Camel endpoints based on characteristics specified on the endpoint (like root QName, SOAP action, etc) 





Message headers




 Name 
 Type 
 Description 


 CamelSpringWebserviceEndpointUri 
 String 
 URI of the web service your accessing as a client, overrides address part of the endpoint URI 


 CamelSpringWebserviceSoapAction 
 String 
 Header to specify the SOAP action of the message, overrides soapAction option if present 


 CamelSpringWebserviceAddressingAction 
 URI 
 Use this header to specify the WS-Addressing action of the message, overrides wsAddressingAction option if present 





Accessing web services

To call a web service at http://foo.com/bar simply define a route:


from("direct:example").to("springws:http://foo.com/bar")



And sent a message:


template.requestBody("direct:example", "foobar xmlns=\"http://foo.com\"msgtest message/msg/foobar");



Sending SOAP and