SOAP Service with WebLogic 12c and Camel

I recently acknowledged that I need to expand on my skills. Not only for business reasons, but also to keep me interested in Integration development. I decided that I wanted to focus on Apache Camel first and coming from the Oracle world I thought it would be fun to get a little experience on using Apache Camel with WebLogic. Most of this, first post, isn't WebLogic specific in any way so most of the information in this post should work in pretty much any servlet container. Later on I want to experiment with using WebLogic JMS queues and so on. So stay tuned for more posts in the future.

For my first endeavor I wanted to try and replicate something simple from Oracle Service Bus. So I decided to try to expose a simple SOAP service using Camel to handle the request and response. After searching a bit around I decided to go ahead and use camel-spring-ws for implementing the SOAP endpoint.

My full source is available on GitHub here

In this post I will try to highlight the things that I had trouble with. But this won't be a full tutorial on how to get this working. Think of it more like a collection of notes from my endeavor.

Maven Configuration

To build everything with Maven I used the following dependencies


To enable jaxb generation of java classes from my schemas I needed to add the following plugin


Spring WS Configuration

First thing I needed to do was to get Spring WS to expose my service. This was actually pretty easy to do. In my web.xml file I added the following

<web-app version="2.4" xmlns=""

<display-name>Camel and Spring WS</display-name>


This adds the Spring WS MessageDispatcherServlet to my web application. To configure this I needed another xml file called spring-ws-servlet.xml with the following content.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
<bean id="weather" class="">
<property name="schema">
<bean id="xsd" class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="WEB-INF/classes/weather.xsd"/>
<property name="portTypeName" value="weather"/>
<property name="locationUri" value="/weather"/>

This tells Spring WS to expose my service using the weather.xsd schema. A WSDL file is now available at http://localhost:7001/WEBLOGICCONTEXTROOT/weather/weather.wsdl 

NB! Both of these files should be placed in src/main/webapp/WEB-INF/

Camel Configuration

Now I wanted to have my exposed service pass on the payload to Camel for processing. It turns out that all I needed was to add a few sections to the spring-ws-servlet.xml file we created a minute ago. I added the following sections

<camel:camelContext id="camelContext">
<camel:routeBuilder ref="weatherRoute"/>
<bean id="weatherRoute" class=""/>

<bean id="endpointMapping" class="" />

The first adds a Route to Camel and the second simply allows camel to map endpoints to the spring-ws services. After this it is now possible in my Route to reference my Spring WS service.

Camel Route

As seen above I added a Route to Camel called weatherRoute which I implemented in the java class WeatherRoute shown in the following.


import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.dataformat.JaxbDataFormat;

public class WeatherRoute extends RouteBuilder{
public void configure() throws Exception {
JaxbDataFormat jaxb = new JaxbDataFormat();

WeatherProcessor weatherProcessor = new WeatherProcessor();


This is a simple Camel route that gets the requests from my Spring WS service where the Root Element Name is {}WeatherRequest. It then unmarshals the request using jaxb and passes it along to a Camel Processor. The result from that Processor is then marshalled using jaxb and passed back to the requesting client.

That is basically it! Of course I wrote a few more files to tie it all together and implemented a stupid Processor, but all of that is available on Github here