You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/01/02 08:05:37 UTC

[camel] branch master updated: "Provide a Camel CXF example which is using WS-Security stuff" (#2696)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new aec34cd   "Provide a Camel CXF example which is using WS-Security stuff" (#2696)
aec34cd is described below

commit aec34cd1a5686fb99510526f83df344831ca8d81
Author: ramu11 <kr...@gmail.com>
AuthorDate: Wed Jan 2 13:35:26 2019 +0530

     "Provide a Camel CXF example which is using WS-Security stuff" (#2696)
---
 .../README.md                                      | 134 +++++++++++++++++
 .../pom.xml                                        | 162 +++++++++++++++++++++
 .../org/apache/camel/example/cxf/ws/Client.java    |  53 +++++++
 .../apache/camel/example/cxf/ws/HelloWorld.java    |  27 ++++
 .../camel/example/cxf/ws/HelloWorldImpl.java       |  31 ++++
 .../camel/example/cxf/ws/UserPasswordCallback.java |  38 +++++
 .../resources/META-INF/spring/camel-context.xml    |  72 +++++++++
 .../src/main/resources/log4j.properties            |  32 ++++
 .../org/apache/camel/example/cxf/ws/request.xml    |  21 +++
 .../src/main/resources/server-truststore.jks       | Bin 0 -> 639 bytes
 examples/pom.xml                                   |   1 +
 11 files changed, 571 insertions(+)

diff --git a/examples/camel-example-cxf-ws-security-signature/README.md b/examples/camel-example-cxf-ws-security-signature/README.md
new file mode 100644
index 0000000..8a3494a
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/README.md
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+CXF WS-SECURITY OSGi HTTP WEB SERVICE
+=========================
+
+### Introduction
+-------
+Create a web service with CXF using WS-SECURITY Signature action and expose it through the OSGi HTTP
+Service, the main purpose is to demonstrate how to use signaturePropRefId WSS4J configuration in
+OSGi container.
+
+
+Explanation
+-----------
+The web service is a simple JAX-WS web service with ws-security Signature and UsernameToken action called HelloWorldSecurity. The 
+interface and the implementation are located in the src/main/java/org/
+apache/camel/example/cxf/ws directory of this example.
+
+The camel-context.xml file, located in the src/main/resources/META-INF/spring
+directory:
+
+
+1. Configures the web service endpoint as follows:
+
+    <jaxws:endpoint id="helloWorld"
+        implementor="org.apache.camel.example.cxf.ws.HelloWorldImpl"
+        address="/HelloWorldSecurity">
+        <jaxws:inInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+                <constructor-arg>
+                    <map>
+                        <entry key="action" value="UsernameToken Signature"/>
+                        <entry key="passwordType" value="PasswordText"/>
+                        <entry key="passwordCallbackRef">
+                            <ref bean="myPasswordCallback"/>
+                        </entry>
+                        <entry key="signaturePropRefId" value="wsCryptoProperties"/>
+                        <entry key="wsCryptoProperties" value-ref="wsCryptoProperties"/>
+                    </map>
+                </constructor-arg>
+            </bean>
+            <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
+        </jaxws:inInterceptors>
+    </jaxws:endpoint>
+    
+    <util:properties id="wsCryptoProperties">
+
+       <prop
+            key="org.apache.ws.security.crypto.provider">org.apache.ws.security.components.crypto.Merlin</prop>
+
+       <prop
+            key="org.apache.ws.security.crypto.merlin.keystore.type">jks</prop>
+
+       <prop
+           key="org.apache.ws.security.crypto.merlin.keystore.password">storepassword</prop>
+
+       <prop
+           key="org.apache.ws.security.crypto.merlin.keystore.file">server-truststore.jks</prop>
+    </util:properties>
+
+### Build
+You will need to compile this example first:
+
+	mvn install
+
+### Run
+
+To run the example on Apache Karaf 4.x or newer
+
+#### Step 1: Karaf
+
+Launch the server
+
+	karaf / karaf.bat
+
+#### Step 2: Add features
+
+Add features required
+
+	feature:install cxf
+	feature:install camel
+	feature:install camel-cxf
+
+#### Step 3: Deploy
+Deploy the example
+                 install -s mvn:org.apache.camel.example/camel-example-cxf-ws-security-signature/${version}
+
+To view the service WSDL, open your browser and go to the following
+URL:
+
+  http://localhost:8181/cxf/HelloWorldSecurity?wsdl
+
+
+
+Running a Client
+----------------
+To run the java code client:
+
+1. Change to the <camel_home>/examples/camel-example-cxf-ws-security-signature
+   directory.
+
+2. Run the following command:
+
+     mvn compile exec:java
+
+   If the client request is successful, 
+   it will print out
+       <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayHelloResponse xmlns:ns2="http://cxf.apache.org/wsse/handler/helloworld"><return>Hello CXF</return></ns2:sayHelloResponse></soap:Body></soap:Envelope>
+       
+### Forum, Help, etc
+
+If you hit an problems please let us know on the Camel Forums
+	<http://camel.apache.org/discussion-forums.html>
+
+Please help us make Apache Camel better - we appreciate any feedback you may
+have.  Enjoy!
+
+
+The Camel riders!
diff --git a/examples/camel-example-cxf-ws-security-signature/pom.xml b/examples/camel-example-cxf-ws-security-signature/pom.xml
new file mode 100644
index 0000000..c0508bd
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/pom.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+	
+ <parent>
+   <groupId>org.apache.camel.example</groupId>
+   <artifactId>examples</artifactId>
+   <version>3.0.0-SNAPSHOT</version>
+ </parent>
+  
+ <artifactId>camel-example-cxf-ws-security-signature</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Example :: CXF :: WS-Security Signature</name>
+ <description>CXF example using WS-Security Signature Action</description>
+	
+ <properties>
+   <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+   <version.maven-bundle-plugin>${project.version}</version.maven-bundle-plugin>
+   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+	
+ <dependencies>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+    </dependency>
+	<dependency>
+	  <groupId>org.apache.camel</groupId>
+	  <artifactId>camel-spring</artifactId>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.camel</groupId>
+	  <artifactId>camel-cxf</artifactId>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.cxf</groupId>
+	  <artifactId>cxf-rt-ws-security</artifactId>
+	</dependency>
+	<dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+	<dependency>
+	  <groupId>org.slf4j</groupId>
+	  <artifactId>slf4j-api</artifactId>
+	</dependency>
+	<dependency>
+	  <groupId>org.slf4j</groupId>
+	  <artifactId>slf4j-log4j12</artifactId>
+	</dependency>
+	<dependency>
+	  <groupId>log4j</groupId>
+	  <artifactId>log4j</artifactId>
+	</dependency>
+	<dependency>
+	  <groupId>org.apache.camel</groupId>
+	  <artifactId>camel-test-spring</artifactId>
+	  <scope>test</scope>
+	</dependency>
+	</dependencies>
+	
+	<build>
+		<defaultGoal>install</defaultGoal>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<!-- <version></version> -->
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Bundle-SymbolicName>camel-example-cxf-ws-security-signature</Bundle-SymbolicName>
+						<Bundle-Name>Camel :: Example :: CXF ::WS-Security Signature</Bundle-Name>
+						<Import-Package>
+                            javax.jws,
+                            javax.xml.bind.annotation,
+                            javax.xml.namespace,
+                            javax.wsdl,
+                            org.apache.cxf.bus,
+                            org.apache.cxf.bus.spring,
+                            org.apache.cxf.bus.resource,
+                            org.apache.cxf.configuration.spring,
+                            org.apache.cxf.resource,
+                            org.apache.cxf.transport.http,
+                            org.apache.cxf.ws.security.wss4j,
+                            org.springframework.beans.factory.config,
+                            javax.security.auth.callback,
+                            org.apache.wss4j.common.ext,
+                            org.apache.cxf.binding.soap.saaj,
+			                org.apache.commons.io
+                        </Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.8</source>
+					<target>1.8</target>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-resources-plugin</artifactId>
+				<configuration>
+					<encoding>UTF-8</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.camel</groupId>
+				<artifactId>camel-maven-plugin</artifactId>
+				<configuration>
+					<fileApplicationContextUri>src/main/resources/META-INF/spring/camel-context.xml</fileApplicationContextUri>
+				</configuration>
+			</plugin>
+			 <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <configuration>
+                    <mainClass>org.apache.camel.example.cxf.ws.Client</mainClass>
+                    <includePluginDependencies>false</includePluginDependencies>
+                </configuration>
+            </plugin>
+		</plugins>
+	</build>
+  <profiles>
+    <profile>
+      <id>jdk9+-build</id>
+      <activation>
+        <jdk>[9,)</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <argLine>--add-modules java.activation,java.xml.bind,java.xml.ws,jdk.xml.bind --add-opens java.base/java.lang=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime.reflect=ALL-UNNAMED --add-exports=java.xml.ws/com.sun.xml.internal.messaging.saaj.soap.impl=ALL-UNNA [...]
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+</project>
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/Client.java b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/Client.java
new file mode 100755
index 0000000..481e708
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/Client.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.example.cxf.ws;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.commons.io.IOUtils;
+
+
+public class Client {
+    public static void main(String[] args) {
+        try {
+            new Client().sendRequest();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    public void sendRequest() throws Exception {
+        URLConnection connection = new URL("http://localhost:8181/cxf/HelloWorldSecurity")
+                .openConnection();
+        connection.setDoInput(true);
+        connection.setDoOutput(true);
+        OutputStream os = connection.getOutputStream();
+        // Post the request file.
+        InputStream fis = getClass().getClassLoader().getResourceAsStream("org/apache/camel/example/cxf/ws/request.xml");
+        IOUtils.copy(fis, os);
+        // Read the response.
+        InputStream is = connection.getInputStream();
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        IOUtils.copy(is, baos);
+        System.out.println(baos.toString());
+    }
+
+}
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/HelloWorld.java b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/HelloWorld.java
new file mode 100644
index 0000000..519a519
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/HelloWorld.java
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.example.cxf.ws;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+@WebService(name = "HelloWorld", targetNamespace = "http://cxf.apache.org/wsse/handler/helloworld")
+public interface HelloWorld {
+    @WebMethod
+    String sayHello(@WebParam(name = "toWhom") String to);
+
+}
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/HelloWorldImpl.java b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/HelloWorldImpl.java
new file mode 100755
index 0000000..8e7c80e
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/HelloWorldImpl.java
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.example.cxf.ws;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+@WebService(name = "HelloWorld", targetNamespace = "http://cxf.apache.org/wsse/handler/helloworld", 
+            endpointInterface = "org.apache.camel.example.cxf.ws.HelloWorld")
+public class HelloWorldImpl implements HelloWorld {
+    @WebMethod
+    public String sayHello(@WebParam(name = "toWhom") String toWhom) {
+        return "Hello " + toWhom;
+
+    }
+}
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/UserPasswordCallback.java b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/UserPasswordCallback.java
new file mode 100644
index 0000000..ce771ed
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/src/main/java/org/apache/camel/example/cxf/ws/UserPasswordCallback.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.example.cxf.ws;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
+public class UserPasswordCallback implements CallbackHandler {
+
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+
+        WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
+
+        if (pc.getIdentifier().equals("clientx509v1")) {
+            pc.setPassword("storepassword");
+        }
+    }
+
+}
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/resources/META-INF/spring/camel-context.xml b/examples/camel-example-cxf-ws-security-signature/src/main/resources/META-INF/spring/camel-context.xml
new file mode 100644
index 0000000..2a90c3a
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/src/main/resources/META-INF/spring/camel-context.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<!-- Configures the Camel Context-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd       
+     http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+     http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
+      http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+   
+   <bean id="myPasswordCallback" class="org.apache.camel.example.cxf.ws.UserPasswordCallback"/>
+   
+    <jaxws:endpoint id="helloWorld"
+        implementor="org.apache.camel.example.cxf.ws.HelloWorldImpl"
+        address="/HelloWorldSecurity">
+        <jaxws:inInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+                <constructor-arg>
+                    <map>
+                        <entry key="action" value="UsernameToken Signature"/>
+                        <entry key="passwordType" value="PasswordText"/>
+                        <entry key="passwordCallbackRef">
+                            <ref bean="myPasswordCallback"/>
+                        </entry>
+                        <entry key="signaturePropRefId" value="wsCryptoProperties"/>
+                        <entry key="wsCryptoProperties" value-ref="wsCryptoProperties"/>
+                    </map>
+                </constructor-arg>
+            </bean>
+            <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
+        </jaxws:inInterceptors>
+    </jaxws:endpoint>
+    
+    <util:properties id="wsCryptoProperties">
+
+       <prop
+            key="org.apache.ws.security.crypto.provider">org.apache.ws.security.components.crypto.Merlin</prop>
+
+       <prop
+            key="org.apache.ws.security.crypto.merlin.keystore.type">jks</prop>
+
+       <prop
+           key="org.apache.ws.security.crypto.merlin.keystore.password">storepassword</prop>
+
+       <prop
+           key="org.apache.ws.security.crypto.merlin.keystore.file">server-truststore.jks</prop>
+    </util:properties>
+
+   
+    <camelContext id="test-example-context" xmlns="http://camel.apache.org/schema/spring">
+     
+    </camelContext>
+</beans>
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/resources/log4j.properties b/examples/camel-example-cxf-ws-security-signature/src/main/resources/log4j.properties
new file mode 100644
index 0000000..4923459
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/src/main/resources/log4j.properties
@@ -0,0 +1,32 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+log4j.rootLogger=INFO, out
+
+#log4j.logger.org.apache.camel=DEBUG
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d %-5p %c{1} - %m %n
+log4j.appender.file.file=target/camel-test.log
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/resources/org/apache/camel/example/cxf/ws/request.xml b/examples/camel-example-cxf-ws-security-signature/src/main/resources/org/apache/camel/example/cxf/ws/request.xml
new file mode 100644
index 0000000..cc6ff6c
--- /dev/null
+++ b/examples/camel-example-cxf-ws-security-signature/src/main/resources/org/apache/camel/example/cxf/ws/request.xml
@@ -0,0 +1,21 @@
+<?xml version = "1.0"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap:mustUnderstand="1"><wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/20 [...]
diff --git a/examples/camel-example-cxf-ws-security-signature/src/main/resources/server-truststore.jks b/examples/camel-example-cxf-ws-security-signature/src/main/resources/server-truststore.jks
new file mode 100644
index 0000000..2447028
Binary files /dev/null and b/examples/camel-example-cxf-ws-security-signature/src/main/resources/server-truststore.jks differ
diff --git a/examples/pom.xml b/examples/pom.xml
index afa1a3b..a480f01 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -58,6 +58,7 @@
     <module>camel-example-cxf-blueprint</module>
     <module>camel-example-cxf-proxy</module>
     <module>camel-example-cxf-tomcat</module>
+    <module>camel-example-cxf-ws-security-signature</module>
     <module>camel-example-console</module>
     <module>camel-example-ehcache-blueprint</module>
     <module>camel-example-ftp</module>