Provision Web Services applications using Fabric

In this tutorial we will learn how to provision a blueprint project on Fabric, creating some containers to run the bundle.

In the first tutorial we have covered how to expose Web Services using a Camel Route and proxy the invocation to a legacy Web service running on EAP 6: Proxy Web services request with Camel

In the second tutorial we have exposed the Web service as an OSGi bundle on JBoss Fuse: Mediate Web Services request with JBoss Fuse

Now we can move one step forward by provisioning a child Containers on Fabric8 to run this example.

Fabric8 is an integration platform based on Apache ActiveMQ, Apache Camel, Apache CXF, Apache Karaf, Hawtio and others.It provides automated configuration and deployment management to help make deployments easy, reproducible, and less human-error prone.

By default, Fabric8 starts up with a default admin user with username admin and password admin. This can be changed by editing the etc/ file before starting fabric for the first time.


then start JBoss Fuse as usual:


You will need to create a Fabric as first operation

JBossFuse:karaf@root> fabric:create --zookeeper-password admin  

Next you will need to create a Profile, which is a collection of features (such as libraries), configuration files and more. Out of the box some default profiles are included, we will create a custom profile names custom-profile which contains the features needed to run our example. From the karaf shell execute the following commands:

JBossFuse:karaf@root> fabric:profile-create custom-profile
JBossFuse:karaf@root> fabric:profile-edit --features camel-cxf custom-profile
JBossFuse:karaf@root> fabric:profile-edit --features camel-blueprint custom-profile

Done with the profile, we will create a child Container named child1 where we will provision our application. The container will use our custom-profile just created:

JBossFuse:karaf@root> fabric:container-create-child --profile custom-profile root child1

Great. Now let's get back to our project discussed in tutorial 2: Mediate Web Services request with JBoss Fuse

The only change in the blue print XML file will be the Apache CXF Web service facade, which will not be bound to a specific port or IP address, but will inherit this information from your container:

<?xml version="1.0" encoding="UTF-8"?>

  <cxf:bus><!-- interceptor per request/response del ws/rest -->
      <cxf:logging limit="1024"/>
  <bean id="beanAdapter" class=""/>

  <camelcxf:cxfEndpoint id="input-cxf" address="/example-input-cxf/"

  <camelcxf:cxfEndpoint id="SimpleWebSevice"
                    serviceClass="" />
  <camelContext id="example-cxf" xmlns="">
    <route id="input-cxf">
      <from uri="cxf:bean:input-cxf"/>
      <log message="Message input: ${in.body}"/>
                <method bean="beanAdapter" method="transform"  />
      <removeHeaders pattern="*"/>
        <to uri="cxf:bean:SimpleWebSevice" />


Now re-build your project and prepare to deploy in on fabric8:

mvn clean install

Move to the karaf shell and upgrade your profile with the maven project:

JBossFuse:karaf@root> fabric:profile-edit -b mvn:it.fuse.demo/fuse-demo/0.0.3-SNAPSHOT custom-profile

You can check from the Web console (located at localhost:8181) for the list of Containers available:

fabric8 tutorial

By clicking on the Container link, you can check the active services:

fabric 8 tutorial

The Container child1 has been assigned the virtual IP address, hence the WSDL of the Web service is available at the following address:

You can check out using SOAPUI or any other Web service client that the Web service responds and the route camel forwards the call to the target Web service.

<soapenv:Envelope xmlns:soapenv="" xmlns:ws="">

You should expect as return a response with the sum of the two parameters of the Wrapper object:

<soap:Envelope xmlns:soap="">
      <ns2:countResponse xmlns:ns2="">



Cookie Alert