Search code examples
restsoapcxfapache-camelapache-axis

How to define an Apache Camel Route "from SOAP Web Service"?


I am working on a small camel application that needs to read data from a third party SOAP Web Service.

I wanted a camel route similar to this:

public class MyCamelRouter extends RouteBuilder {

@Override
public void configure() throws Exception {
    from("???:mySoapOrRestWebService")
        .to("jms:queue:someQueue"));
}

At first i thought that this could be done with camel-cxf, but its documentation does not mention it.

The only solution that i've found so far is to implement a polling consumer and use it with a timer on the "from" of my route definition.

Is this solution the correct one? Or can this be achieved with some other camel component?

I also need to define a similar route but using a REST web service in the "from"


Solution

  • The only solution that i found for this is to use a timer in the from and call the SOAP web service afterwards.

    The code i used looks like this:

    public class MyCamelRouter extends RouteBuilder {
    
    @Override
    public void configure() throws Exception {
        from("timer:soapRequestTimer?{options}")
            .to("cxf:serviceUrl"));
            .to("jms:queue:someQueue"));
    }