esbperformance / karaf / secure-proxy / src / main / resources / OSGI-INF / blueprint / bundle-context.xml

<?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.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:camel="http://camel.apache.org/schema/blueprint"
    xmlns:camel-cxf="http://camel.apache.org/schema/blueprint/cxf"
    xsi:schemaLocation="
       http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
       http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
       http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/cxf/camel-cxf-blueprint.xsd">

    <camel-cxf:cxfEndpoint id="secureProxy"
        address="/SecureProxy"
        endpointName="service:EchoServicePort"
        serviceName="service:SecureProxy"
        wsdlURL="wsdl/SecureProxyWSDL-consumer-embedded.wsdl"
        xmlns:service="http://services.samples/xsd">

        <camel-cxf:inInterceptors>
            <ref component-id="TimestampSignEncrypt_Request" />
        </camel-cxf:inInterceptors>
        <camel-cxf:outInterceptors>
            <ref component-id="TimestampSignEncrypt_Response" />
        </camel-cxf:outInterceptors>
        <camel-cxf:properties>
            <entry key="dataFormat" value="PAYLOAD" />
            <entry key="ws-security.enable.nonce.cache" value="false" />
            <entry key="ws-security.enable.timestamp.cache" value="false" />
        </camel-cxf:properties>
    </camel-cxf:cxfEndpoint>

    <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor" id="TimestampSignEncrypt_Request">
        <argument>
            <map>
                <entry key="action" value="Timestamp Signature Encrypt" />
                <entry key="signaturePropFile" value="wssecurity.properties" />
                <entry key="decryptionPropFile" value="wssecurity.properties" />
                <entry key="passwordCallbackClass" value="org.apache.cmueller.camel.esbperf.karaf.secproxy.WSSecurityPasswordCallback" />
                <entry key="timeToLive" value="1147483" />
                <entry key="futureTimeToLive" value="1147483" />
                <entry key="timestampStrict" value="false" />
            </map>
        </argument>
    </bean>
    
    <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor" id="TimestampSignEncrypt_Response">
        <argument>
            <map>
                <entry key="action" value="Timestamp Signature Encrypt" />
                <entry key="user" value="Alice" />
                <entry key="signaturePropFile" value="wssecurity.properties" />
                <entry key="encryptionPropFile" value="wssecurity.properties" />
                <entry key="encryptionUser" value="bob" />
                <entry key="encryptionKeyIdentifier" value="SKIKeyIdentifier" />
                <entry key="signatureKeyIdentifier" value="DirectReference" />
                <entry key="passwordCallbackClass" value="org.apache.cmueller.camel.esbperf.karaf.secproxy.WSSecurityPasswordCallback" />
                <entry key="signatureParts" value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
                <entry key="encryptionParts" value="{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
                <entry key="encryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#aes128-cbc" />
                <entry key="timestampStrict" value="false" />
                <entry key="isBSPCompliant" value="false" />
            </map>
        </argument>
    </bean>

    <camel-cxf:cxfEndpoint id="echoService"
        address="http://localhost:9000/service/EchoService"
        endpointName="service:EchoServicePort"
        serviceName="service:SecureEchoService"
        wsdlURL="wsdl/SecureProxyWSDL-provider-embedded.wsdl"
        bindingId="service:EchoServiceSOAP11Binding"
        xmlns:service="http://services.samples/xsd">

        <camel-cxf:properties>
            <entry key="dataFormat" value="PAYLOAD" />
            <entry key="ws-security.enable.nonce.cache" value="false" />
            <entry key="ws-security.enable.timestamp.cache" value="false" />
        </camel-cxf:properties>
    </camel-cxf:cxfEndpoint>

    <bean id="dropAllMessageHeadersStrategy" class="org.apache.camel.component.cxf.common.header.CxfHeaderFilterStrategy">
        <property name="relayHeaders" value="false"/>
    </bean>

    <camel:camelContext>
        <camel:jmxAgent id="agent" disabled="true"/>

        <camel:route id="cxf-secure-proxy" streamCache="true">
            <camel:from uri="cxf:bean:secureProxy" />
            <camel:to uri="cxf:bean:echoService" />
        </camel:route>
    </camel:camelContext>
</blueprint>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.