SPRING-WS

The SPRING-WS component allows to call web service (i.e. performing SOAP requests) in a simple way. Learn how to work with the SPING-WS component.

Library

Create a new library with the following jars (in this order):

See also How to retrieve the Camel version of Decision Insight.

Routes

Now it's possible to create a route that uses this component. Here the definition of the route:

<routes xmlns="http://camel.apache.org/schema/spring" xmlns:u="http://www.systar.com/aluminium/camel-util">
    <route>
        <!-- Call only one time -->
        <from uri="timer:foo?repeatCount=1"/>
        <!-- Prepare the SOAP request -->
        <setBody>
            <constant><![CDATA[<getTableContent><table>host</table></getTableContent>]]></constant>
        </setBody>
        <!-- Send the SOAP request and convert the result as String -->
        <to uri="spring-ws:https://localhost:7777/webservice.php"/>
        <convertBodyTo type="java.lang.String"/>
        <!-- Log the result -->
        <to uri="log:ws-results"/>
    </route>
</routes>

Related Links