You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2009/08/21 09:30:37 UTC

svn commit: r806435 - in /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src: main/java/org/apache/servicemix/cxfbc/interceptors/ test/java/org/apache/servicemix/cxfbc/ws/security/ test/resources/org/apache/serv...

Author: ffang
Date: Fri Aug 21 07:30:37 2009
New Revision: 806435

URL: http://svn.apache.org/viewvc?rev=806435&view=rev
Log:
[SMX4-618]should use StaxUtils.writeElement/Node with repairing true instead of add namespace explicitly

Added:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/CxfBcProviderConsumerMtomSecurityTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/SecurityMtomServer.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/mtom_security_bridage.xml
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/server_mtom.xml
Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java?rev=806435&r1=806434&r2=806435&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java Fri Aug 21 07:30:37 2009
@@ -24,9 +24,7 @@
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.transform.Source;
 
-import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
@@ -89,10 +87,10 @@
                             soapVersion.getBody().getLocalPart()).item(0);
                     }
                     if (bodyElement != null) {
-                        StaxUtils.writeElement(DomUtil.getFirstChildElement(bodyElement), xmlWriter, false);
+                        StaxUtils.writeElement(DomUtil.getFirstChildElement(bodyElement), xmlWriter, true);
                     } else {
                         // if this message is coming from the CxfBCProvider 
-                        StaxUtils.writeElement(element, xmlWriter, false);
+                        StaxUtils.writeElement(element, xmlWriter, true);
                     }
                 }
                 return;
@@ -107,12 +105,7 @@
                         + JbiConstants.WSDL11_WRAPPER_NAMESPACE + "}message'"));
             }
             
-            //save namespace which is potentially used by the soap message
-            List<Attr> nsList = saveLaterUsedNS(element);
-            //add the saved namespace to the soap body
-            for (Attr attr : nsList) {
-                xmlWriter.writeAttribute(attr.getName(), attr.getValue());
-            }
+           
 
             BindingOperationInfo bop = message.getExchange().get(
                     BindingOperationInfo.class);
@@ -141,7 +134,7 @@
                     for (NodeList nl : partsContent) {
                         for (int i = 0; i < nl.getLength(); i++) {
                             Node n = nl.item(i);                            
-                            StaxUtils.writeNode(n, xmlWriter, false);
+                            StaxUtils.writeNode(n, xmlWriter, true);
                         }
                     }
                     partWrapper = DomUtil.getNextSiblingElement(partWrapper);
@@ -159,22 +152,7 @@
         }
     }
 
-    private List<Attr> saveLaterUsedNS(Element element) {
-        List<Attr> nsList = new ArrayList<Attr>();
-        NamedNodeMap attributes = element.getAttributes();
-        for (int i = 0; i < attributes.getLength(); i++) {
-            if (attributes.item(i) instanceof Attr) {
-                Attr attr = (Attr) attributes.item(i);
-                if (attr.getName().startsWith("xmlns:")
-                        && !(attr.getName().startsWith("xmlns:" + JbiConstants.WSDL11_WRAPPER_MESSAGE_PREFIX)
-                                || attr.getName().startsWith("xmlns:" + JbiConstants.WSDL11_WRAPPER_PREFIX))) {
-                    nsList.add(attr);
-                }
-            }
-        }
-        return nsList;
-    }
-
+    
     
     
     private void getRPCPartWrapper(BindingMessageInfo msg, 
@@ -195,7 +173,7 @@
                 for (NodeList nl : partsContent) {
                     for (int i = 0; i < nl.getLength(); i++) {
                         Node n = nl.item(i);
-                        StaxUtils.writeNode(n, xmlWriter, false);
+                        StaxUtils.writeNode(n, xmlWriter, true);
                     }
                 }
                 xmlWriter.writeEndElement();

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/CxfBcProviderConsumerMtomSecurityTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/CxfBcProviderConsumerMtomSecurityTest.java?rev=806435&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/CxfBcProviderConsumerMtomSecurityTest.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/CxfBcProviderConsumerMtomSecurityTest.java Fri Aug 21 07:30:37 2009
@@ -0,0 +1,172 @@
+/*
+ * 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.servicemix.cxfbc.ws.security;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.activation.DataHandler;
+import javax.mail.util.ByteArrayDataSource;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Holder;
+import javax.xml.ws.soap.SOAPBinding;
+
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.ClientImpl;
+import org.apache.cxf.jaxws.JaxWsClientProxy;
+import org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl;
+import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.mime.TestMtom;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.testutil.common.ServerLauncher;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class CxfBcProviderConsumerMtomSecurityTest extends SpringTestSupport {
+//public class CxfBcProviderConsumerMtomTest extends TestCase {
+    
+    public static final QName MTOM_PORT = new QName(
+            "http://cxf.apache.org/mime", "TestMtomPort");
+
+    public static final QName MTOM_SERVICE = new QName(
+            "http://cxf.apache.org/mime", "TestMtomService");
+    private ServerLauncher sl;
+    
+    protected void setUp() throws Exception {
+        super.setUp();
+        
+        assertTrue(
+            "Server failed to launch",
+            // run the server in another process
+            // set this to false to fork
+            launchServer(SecurityMtomServer.class, false));
+    }
+    
+    protected void tearDown() throws Exception {
+       
+        try {
+            sl.stopServer();
+        } catch (IOException ex) {
+            ex.printStackTrace();
+            fail("failed to stop server " + sl.getClass());
+        }
+    }
+    
+    
+    public boolean launchServer(Class<?> clz, boolean inProcess) {
+        boolean ok = false;
+        try { 
+            // java.security.properties is set when using the ibm jdk to work
+            // around some security test issues.  Check our system properties
+            // for this key, and if it's set, then propagate the property on
+            // to the server we launch as well.
+            Map<String, String> properties = null;
+            if (System.getProperty("java.security.properties") != null) {
+                properties = new HashMap<String, String>();
+                properties.put("java.security.properties",
+                    System.getProperty("java.security.properties"));
+            }
+            sl = new ServerLauncher(clz.getName(), properties, null, inProcess);
+            ok = sl.launchServer();            
+            assertTrue("server failed to launch", ok);
+            
+        } catch (IOException ex) {
+            ex.printStackTrace();
+            fail("failed to launch server " + clz);
+        }
+        
+        return ok;
+    }
+
+    public void testBridge() throws Exception {
+      
+    
+        
+        // start external client
+        TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class,
+                true);
+        try {
+            
+            Holder<DataHandler> param = new Holder<DataHandler>();
+            
+            param.value = new DataHandler(new ByteArrayDataSource("foobar".getBytes(), 
+                "application/octet-stream"));
+            
+            Holder<String> name = new Holder<String>("call detail");
+            mtomPort.testXop(name, param);
+            assertEquals("call detailfoobar",
+                    name.value);
+            assertNotNull(param.value);
+            InputStream bis = param.value.getDataSource().getInputStream();
+            byte b[] = new byte[10];
+            bis.read(b, 0, 10);
+            String attachContent = new String(b);
+            assertEquals(attachContent, "testfoobar");
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception) ex.getCause();
+        }
+
+    }
+
+    @Override
+    protected AbstractXmlApplicationContext createBeanFactory() {
+        return new ClassPathXmlApplicationContext(
+                "org/apache/servicemix/cxfbc/ws/security/mtom_security_bridage.xml");
+    }
+    
+    private <T> T createPort(QName serviceName, QName portName,
+            Class<T> serviceEndpointInterface, boolean enableMTOM)
+        throws Exception {
+        SpringBusFactory factory = new SpringBusFactory();
+        Bus bus = factory.createBus();
+        ReflectionServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
+        serviceFactory.setBus(bus);
+        
+        serviceFactory.setServiceName(serviceName);
+        serviceFactory.setServiceClass(serviceEndpointInterface);
+        serviceFactory.setWsdlURL(getClass().getResource("/wsdl/mtom_xop.wsdl"));
+        Service service = serviceFactory.create();
+        EndpointInfo ei = service.getEndpointInfo(portName);
+        JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service,
+                ei);
+        SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding());
+        jaxWsSoapBinding.setMTOMEnabled(enableMTOM);
+
+        Client client = new ClientImpl(bus, jaxwsEndpoint);
+       
+        InvocationHandler ih = new JaxWsClientProxy(client, jaxwsEndpoint
+                .getJaxwsBinding());
+        Object obj = Proxy.newProxyInstance(serviceEndpointInterface
+                .getClassLoader(), new Class[] {serviceEndpointInterface,
+                    BindingProvider.class}, ih);
+        return serviceEndpointInterface.cast(obj);
+    }
+
+}

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/SecurityMtomServer.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/SecurityMtomServer.java?rev=806435&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/SecurityMtomServer.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/ws/security/SecurityMtomServer.java Fri Aug 21 07:30:37 2009
@@ -0,0 +1,52 @@
+/*
+ * 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.servicemix.cxfbc.ws.security;
+
+import java.util.logging.Logger;
+
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class SecurityMtomServer extends AbstractBusTestServerBase {
+    
+    private static final Logger LOG = LogUtils.getL7dLogger(SecurityMtomServer.class);
+    
+    protected void run()  {
+        SpringBusFactory factory = new SpringBusFactory();
+        Bus bus = factory.createBus(
+            "org/apache/servicemix/cxfbc/ws/security/server_mtom.xml"
+        );
+        BusFactory.setDefaultBus(bus);
+        
+    }
+        
+    public static void main(String[] args) {
+        try { 
+            SecurityMtomServer s = new SecurityMtomServer(); 
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally { 
+            LOG.info("done!");
+        }
+    }
+}

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/mtom_security_bridage.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/mtom_security_bridage.xml?rev=806435&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/mtom_security_bridage.xml (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/mtom_security_bridage.xml Fri Aug 21 07:30:37 2009
@@ -0,0 +1,116 @@
+<?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.
+  
+-->
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
+       xmlns:mtom="http://cxf.apache.org/mime">
+  
+  <sm:container id="jbi" embedded="true">
+    
+    <sm:endpoints>
+      <cxfbc:consumer wsdl="/wsdl/mtom_xop.wsdl"
+                      service="mtom:TestMtomService"
+                      endpoint="TestMtomPort"
+                      targetEndpoint="TestMtomPortProxy"
+                      targetService="mtom:TestMtomService"
+                      targetInterface="mtom:TestMtom"
+                      >
+          <cxfbc:inInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inInterceptors>
+          <cxfbc:outInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outInterceptors>
+          <cxfbc:inFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inFaultInterceptors>
+          <cxfbc:outFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outFaultInterceptors>
+      </cxfbc:consumer>
+
+      <cxfbc:provider wsdl="/wsdl/mtom_xop.wsdl"
+                      locationURI="http://localhost:9001/mtombridgetest"
+                      service="mtom:TestMtomService"
+                      endpoint="TestMtomPortProxy"
+                      interfaceName="mtom:TestMtom"
+                     >
+          <cxfbc:inInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inInterceptors>
+          <cxfbc:outInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+            <bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
+            <ref bean="TimestampSignEncrypt_Request"/>
+          </cxfbc:outInterceptors>
+          <cxfbc:inFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+          </cxfbc:inFaultInterceptors>
+          <cxfbc:outFaultInterceptors>
+            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+          </cxfbc:outFaultInterceptors>
+      </cxfbc:provider> 
+    </sm:endpoints>
+    
+  </sm:container>
+
+  <!-- -->
+    <!-- This bean is an Out interceptor which will add a Timestamp, -->
+    <!-- sign the Timstamp and Body, and then encrypt the Timestamp -->
+    <!-- and Body.  It uses 3DES as the symmetric key algorithm. -->
+    <!-- -->
+    <bean
+        class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"
+        id="TimestampSignEncrypt_Request">
+        <!--constructor-arg>
+            <map>
+                <entry key="action" value="Timestamp Signature Encrypt"/>
+                <entry key="user" value="alice"/>
+                <entry key="signaturePropFile" value="org/apache/servicemix/cxfbc/ws/security/alice.properties"/>
+                <entry key="encryptionPropFile" value="org/apache/servicemix/cxfbc/ws/security/bob.properties"/>
+                <entry key="encryptionUser" value="Bob"/>
+                <entry key="signatureKeyIdentifier" value="DirectReference"/>
+                <entry key="passwordCallbackClass" value="org.apache.servicemix.cxfbc.ws.security.KeystorePasswordCallback"/>
+                <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="{Element}{http://www.w3.org/2000/09/xmldsig#}Signature;{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body"/>
+                <entry key="encryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
+            </map>
+        </constructor-arg-->
+        <constructor-arg>
+
+                                        <map>
+                                                <entry key="action" value="Signature" />
+                                                <entry key="passwordCallbackRef">
+                                                        <ref bean="myPasswordCallback" />
+                                                </entry>
+                                                <entry key="signaturePropFile"
+                                                        value="org/apache/servicemix/cxfbc/ws/security/alice.properties" />
+                                                <entry key="user" value="alice" />
+                                                <entry key="signatureParts"
+                                                        value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
+                                        </map>
+                                </constructor-arg>
+                                <!--property name="allowMTOM" value="true" /-->
+
+    </bean>
+    <bean id="myPasswordCallback"
+                class="org.apache.servicemix.cxfbc.ws.security.KeystorePasswordCallback" />
+  
+  
+</beans>

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/server_mtom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/server_mtom.xml?rev=806435&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/server_mtom.xml (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/server_mtom.xml Fri Aug 21 07:30:37 2009
@@ -0,0 +1,75 @@
+<?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.
+-->
+<beans 
+    xmlns="http://www.springframework.org/schema/beans"
+    xmlns:cxf="http://cxf.apache.org/core"
+    xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:test="http://cxf.apache.org/mime"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="
+        http://cxf.apache.org/core                                      http://cxf.apache.org/schemas/core.xsd
+        http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+        http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.xsd
+    ">
+    
+    <!-- -->
+    <!-- Enable logging at all endpoints -->
+    <!-- -->
+    <cxf:bus>
+        <cxf:features>
+            <bean class="org.apache.cxf.feature.LoggingFeature"/>
+        </cxf:features>
+    </cxf:bus>
+
+    <jaxws:endpoint 
+        id="MtomSecurityEndpoint"
+        implementor="org.apache.servicemix.cxfbc.mtom.TestMtomImpl"
+        address="http://localhost:9001/mtombridgetest"
+        serviceName="test:TestMtomService"
+        endpointName="test:TestMtomPort"
+        >
+       <jaxws:properties>
+           <entry key="mtom-enabled" value="true"/>
+           </jaxws:properties>
+
+
+        <jaxws:inInterceptors>
+            <ref bean="TimestampSignEncrypt_Request"/>
+            <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+        </jaxws:inInterceptors>
+    </jaxws:endpoint>
+    <bean
+        class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
+        id="TimestampSignEncrypt_Request">
+        <constructor-arg>
+            <map>
+                <!-- Use this action order for local clients -->
+                <entry key="action" value="Signature"/>
+                <!-- Use this action spec for WCF clients
+                <entry key="action" value="Signature"/>
+                -->
+                <entry key="signaturePropFile" value="org/apache/servicemix/cxfbc/ws/security/alice.properties"/>
+                <entry key="decryptionPropFile" value="org/apache/servicemix/cxfbc/ws/security/bob.properties"/>
+                <entry key="passwordCallbackClass" value="org.apache.servicemix.cxfbc.ws.security.KeystorePasswordCallback"/>
+            </map>
+        </constructor-arg>
+    </bean>
+    
+</beans>