Download Component Reference - Red Hat Customer Portal
Transcript
Chapter 83. Spring Web Services
The following route will receive web service requests containing the http://example.com/GetFoo SOAP
action:
from("spring-ws:soapaction:http://example.com/GetFoo?endpointMapping=#endpointMapping")
.convertBodyTo(String.class).to(mock:example)
The following route will receive all requests sent to http://example.com/foobar:
from("spring-ws:uri:http://example.com/foobar?endpointMapping=#endpointMapping")
.convertBodyTo(String.class).to(mock:example)
The route below receives requests that contain the element <foobar>abc</foobar> anywhere inside the
message (and the default namespace).
from("spring-ws:xpathresult:abc?expression=//foobar&endpointMapping=#endpointMapping")
.convertBodyTo(String.class).to(mock:example)
Alternative configuration, using existing endpoint mappings
For every endpoint with mapping-type beanname one bean of type CamelEndpointDispatcher with a
corresponding name is required in the Registry/ApplicationContext. This bean acts as a bridge between the
9
Camel endpoint and an existing endpoint mapping like PayloadRootQNameEndpointMapping.
Note
The use of the beanname mapping-type is primarily meant for (legacy) situations where you're already using
Spring-WS and have endpoint mappings defined in a Spring XML file. The beanname mapping-type allows you
to wire your Camel route into an existing endpoint mapping. When you're starting from scratch it's recommended
to define your endpoint mappings as Camel URI's (as illustrated above with endpointMapping) since it requires
less configuration and is more expressive. Alternatively you could use vanilla Spring-WS with the help of
annotations.
An example of a route using beanname:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="spring-ws:beanname:QuoteEndpointDispatcher" />
<to uri="mock:example" />
</route>
</camelContext>
<bean id="legacyEndpointMapping" class="org.springframework.ws.server.endpoint.mapping.Pay
9
http://static.springsource.org/spring-ws/sites/1.5/reference/html/server.html#server-endpoint-mapping
490
Fuse Mediation Router Component Reference Version 2.6
Related documents
JavaBIP User Manual - RiSD
Table of Contents
Network technologies for Java-enabled, mobile devices
Flexible authentication for stateless web services
User Manual Modem Logger
Workflow Patterns - Information Systems
Manutenzione
14 CB1100-3LMGC6100.book
rapport de recherche
JBoss WS CXF User Guide - for use with JBoss
Questo manuale deve essere considerato parte integrante