...
Taking a closer look at the URI reveals that this route consumes messages with a certain rootqname
. In this case it listens for messages with root element incrementRequest
defined in the http://camel.apache.org/example/increment
namespace. These XML messages are unmarshalled to objects using Camel's Data Format support (JAXB in this case). After processing the resulting object is marshalled back to XML and returned to the client as a response.
Further notice that the URI contains a reference to an endpointMapping
in the Registry. Since we're using Spring the registry is a Spring ApplicationContext defined in spring-ws-servlet.xml
. This file contains the following bean:
Code Block | ||||
---|---|---|---|---|
| ||||
<bean id="endpointMapping" class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping"> <property name="interceptors"> <list> <ref local="validatingInterceptor" /> <ref local="loggingInterceptor" /> </list> </property> </bean> |
The endpointMapping
This bean is a Spring-WS endpoint mapping that maps incoming messages to appropriate Camel routes. You'll only need to define a single one CamelEndpointMapping
, regardless of the number of Camel routes using that use Spring-WS endpoints.
The above endpointMapping
bean is automatically picked up by the MessageDispatcherServlet
declared in web.xml
:
...
Since the servlet is named spring-ws
it will look for a the file named /WEB-INF/spring-ws-servlet.xml
containing the earlier mentioned endpointMapping
bean.