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 2008/03/11 05:24:59 UTC

svn commit: r635798 - in /servicemix/smx3/branches/servicemix-3.2/deployables: bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/ bi...

Author: ffang
Date: Mon Mar 10 21:24:57 2008
New Revision: 635798

URL: http://svn.apache.org/viewvc?rev=635798&view=rev
Log:
[SM-1242]CXF BC should support useJBIWrapper
[SM-1266]cxf se need a flag to enable support soap message besides the default jbi message

Added:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java   (with props)
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml   (with props)
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml   (with props)
Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiInWsdl1Interceptor.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOutWsdl1Interceptor.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeProxyFactoryBean.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.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/CxfBcConsumer.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java Mon Mar 10 21:24:57 2008
@@ -44,6 +44,7 @@
 import org.apache.cxf.attachment.AttachmentImpl;
 import org.apache.cxf.binding.AbstractBindingFactory;
 import org.apache.cxf.binding.jbi.JBIFault;
+import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor;
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
@@ -131,9 +132,11 @@
     private boolean mtomEnabled;
 
     private String locationURI;
-    
+
     private int timeout = 10;
 
+    private boolean useJBIWrapper = true;
+
     /**
      * @return the wsdl
      */
@@ -263,20 +266,23 @@
             ei.getBinding().setProperty(
                     AbstractBindingFactory.DATABINDING_DISABLED, Boolean.TRUE);
 
-            cxfService.getInInterceptors().add(
-                    new ReadHeadersInterceptor(getBus()));
             cxfService.getInInterceptors().add(new MustUnderstandInterceptor());
             cxfService.getInInterceptors().add(new AttachmentInInterceptor());
             cxfService.getInInterceptors().add(new StaxInInterceptor());
             cxfService.getInInterceptors().add(
                     new ReadHeadersInterceptor(getBus()));
-            cxfService.getInInterceptors().add(new JbiOperationInterceptor());
-            cxfService.getInInterceptors().add(new JbiInWsdl1Interceptor());
+            cxfService.getInInterceptors().add(
+                    new JbiOperationInterceptor());
+            cxfService.getInInterceptors().add(
+                    new JbiInWsdl1Interceptor(isUseJBIWrapper()));
             cxfService.getInInterceptors().add(new JbiInInterceptor());
             cxfService.getInInterceptors().add(new JbiInvokerInterceptor());
             cxfService.getInInterceptors().add(new JbiPostInvokerInterceptor());
+
             cxfService.getInInterceptors().add(new OutgoingChainInterceptor());
-            cxfService.getOutInterceptors().add(new JbiOutWsdl1Interceptor());
+
+            cxfService.getOutInterceptors().add(
+                    new JbiOutWsdl1Interceptor(isUseJBIWrapper()));
             cxfService.getOutInterceptors().add(new SoapActionOutInterceptor());
             cxfService.getOutInterceptors().add(new AttachmentOutInterceptor());
             cxfService.getOutInterceptors().add(
@@ -288,6 +294,7 @@
                     new SoapOutInterceptor(getBus()));
             cxfService.getOutFaultInterceptors().add(
                     new SoapOutInterceptor(getBus()));
+
             ep = new EndpointImpl(getBus(), cxfService, ei);
             getInInterceptors().addAll(getBus().getInInterceptors());
             getInFaultInterceptors().addAll(getBus().getInFaultInterceptors());
@@ -402,7 +409,9 @@
             if (invoker instanceof Servant) {
                 // it's rm request, run the invocation directly in bc, not send
                 // to se.
+
                 Exchange runableEx = message.getExchange();
+
                 Object result = invoker.invoke(runableEx, getInvokee(message));
                 if (!cxfExchange.isOneWay()) {
                     Endpoint end = cxfExchange.get(Endpoint.class);
@@ -428,7 +437,6 @@
                             outMessage.setContent(List.class, resList);
                         }
                     }
-                    message.getExchange().setOutMessage(outMessage);
                 }
 
                 return;
@@ -448,7 +456,8 @@
                 if (CxfBcConsumer.this.synchronous
                         && !CxfBcConsumer.this.isOneway) {
                     message.getInterceptorChain().pause();
-                    context.getDeliveryChannel().sendSync(exchange, timeout * 1000);
+                    context.getDeliveryChannel().sendSync(exchange,
+                            timeout * 1000);
                     process(exchange);
                 } else {
                     context.getDeliveryChannel().send(exchange);
@@ -477,15 +486,39 @@
             }
             if (!ex.isOneWay()) {
                 if (exchange.getFault() != null) {
-                    Fault f = new JBIFault(
-                            new org.apache.cxf.common.i18n.Message(
-                                    "Fault occured", (ResourceBundle) null));
-
-                    Element details = toElement(exchange.getFault()
-                            .getContent());
-                    f.setDetail(details);
+                    Fault f = null;
+                    if (isUseJBIWrapper()) {
+                        f = new JBIFault(
+                                new org.apache.cxf.common.i18n.Message(
+                                        "Fault occured", (ResourceBundle) null));
+                        Element details = toElement(exchange.getFault()
+                                .getContent());
+                        f.setDetail(details);
+                        
+                    } else {
+                        Element details = toElement(exchange.getFault()
+                                .getContent());
+                        
+                        
+                        details = (Element) details.getElementsByTagNameNS(
+                                details.getNamespaceURI(), "Body").item(0);
+                        assert details != null;
+                        details = (Element) details.getElementsByTagNameNS(
+                                details.getNamespaceURI(), "Fault").item(0);
+                        assert details != null;
+                        details = (Element) details.getElementsByTagName("detail").item(0);
+                        assert details != null;
+                        f = new SoapFault(
+                                new org.apache.cxf.common.i18n.Message(
+                                        "Fault occured", (ResourceBundle) null),
+                                new QName(details.getNamespaceURI(), "detail"));
+                        f.setDetail(details);
+
+                    }
                     processFaultDetail(f, message);
                     message.put(BindingFaultInfo.class, faultWanted);
+                    
+
                     throw f;
                 } else if (exchange.getMessage("out") != null) {
                     Endpoint endpoint = ex.get(Endpoint.class);
@@ -497,7 +530,6 @@
                     NormalizedMessageImpl norMessage = (NormalizedMessageImpl) exchange
                             .getMessage("out");
 
-                    // -- MODIFIED
                     if (outMessage instanceof SoapMessage) {
                         AddressingProperties addressingProperties = WSAUtils
                                 .getCXFAddressingPropertiesFromMap((Map<String, String>) norMessage
@@ -601,6 +633,14 @@
 
     public int getTimeout() {
         return timeout;
+    }
+
+    public void setUseJBIWrapper(boolean useJBIWrapper) {
+        this.useJBIWrapper = useJBIWrapper;
+    }
+
+    public boolean isUseJBIWrapper() {
+        return useJBIWrapper;
     }
 
 }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.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/CxfBcProvider.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java Mon Mar 10 21:24:57 2008
@@ -113,6 +113,10 @@
     
     private boolean mtomEnabled;
     
+    private boolean useJBIWrapper = true;
+    
+    
+    
     public void processExchange(MessageExchange exchange) {
         
     }
@@ -156,9 +160,10 @@
         }
         
         
-        outList.add(new JbiOutWsdl1Interceptor());
+        outList.add(new JbiOutWsdl1Interceptor(isUseJBIWrapper()));
         outList.add(new SoapPreProtocolOutInterceptor());
         outList.add(new SoapOutInterceptor(getBus()));
+        
         PhaseInterceptorChain outChain = outboundChainCache.get(pm.getOutPhases(), outList);
         outChain.add(getOutInterceptors());
         outChain.add(getOutFaultInterceptors());
@@ -174,7 +179,6 @@
         OutputStream os = message.getContent(OutputStream.class);
         XMLStreamWriter writer = message.getContent(XMLStreamWriter.class);
         
-
         String encoding = getEncoding(message);
         
         try {
@@ -360,6 +364,14 @@
 
     public boolean isMtomEnabled() {
         return mtomEnabled;
+    }
+
+    public void setUseJBIWrapper(boolean useJBIWrapper) {
+        this.useJBIWrapper = useJBIWrapper;
+    }
+
+    public boolean isUseJBIWrapper() {
+        return useJBIWrapper;
     }
 
 }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.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/CxfBcProviderMessageObserver.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java Mon Mar 10 21:24:57 2008
@@ -86,7 +86,8 @@
             }
 
             contentType = (String) message.get(Message.CONTENT_TYPE);
-            SoapMessage soapMessage = new SoapMessage(message);
+            SoapMessage soapMessage = 
+                (SoapMessage) this.providerEndpoint.getCxfEndpoint().getBinding().createMessage(message);
 
             // create XmlStreamReader
             BindingOperationInfo boi = providerEndpoint.getEndpointInfo()
@@ -109,7 +110,8 @@
             PhaseManager pm = providerEndpoint.getBus().getExtension(
                     PhaseManager.class);
             List<Interceptor> inList = new ArrayList<Interceptor>();
-            inList.add(new JbiInWsdl1Interceptor());
+            
+            inList.add(new JbiInWsdl1Interceptor(this.providerEndpoint.isUseJBIWrapper()));
 
             PhaseInterceptorChain inChain = inboundChainCache.get(pm
                     .getInPhases(), inList);

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiInWsdl1Interceptor.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/JbiInWsdl1Interceptor.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiInWsdl1Interceptor.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiInWsdl1Interceptor.java Mon Mar 10 21:24:57 2008
@@ -16,7 +16,6 @@
  */
 package org.apache.servicemix.cxfbc.interceptors;
 
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -34,8 +33,10 @@
 
 import org.apache.cxf.binding.jbi.JBIConstants;
 import org.apache.cxf.binding.jbi.JBIFault;
+import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.SoapHeader;
 import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
@@ -50,7 +51,6 @@
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.staxutils.PartialXMLStreamReader;
 import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.servicemix.jbi.jaxp.StaxSource;
 import org.apache.servicemix.jbi.util.QNameUtil;
 import org.apache.servicemix.soap.util.DomUtil;
 
@@ -59,100 +59,134 @@
  */
 public class JbiInWsdl1Interceptor extends AbstractSoapInterceptor {
 
-    public JbiInWsdl1Interceptor() {
+    private boolean useJBIWrapper = true;
+
+    public JbiInWsdl1Interceptor(boolean useJBIWrapper) {
         super(Phase.PRE_INVOKE);
         addAfter(JbiOperationInterceptor.class.getName());
+        this.useJBIWrapper = useJBIWrapper;
     }
-    
+
     public void handleMessage(SoapMessage message) {
         // Ignore faults messages
         if (message.getContent(Exception.class) != null) {
             return;
         }
-        // Check if we should not use the JBI wrapper
-        if (message.get(JbiConstants.USE_JBI_WRAPPER) instanceof Boolean && !((Boolean) message.get(JbiConstants.USE_JBI_WRAPPER))) {
-            XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class);
-            if (xmlReader != null) {
-                message.setContent(Source.class, new StaxSource(xmlReader));
+        Document document = DomUtil.createDocument();
+
+        if (!useJBIWrapper) {
+            
+            SoapVersion soapVersion = message.getVersion();
+            Element soapEnv = DomUtil.createElement(document, new QName(
+                    soapVersion.getEnvelope().getNamespaceURI(), soapVersion
+                            .getEnvelope().getLocalPart(), soapVersion
+                            .getPrefix()));
+            Element soapBody = DomUtil.createElement(soapEnv, new QName(
+                    soapVersion.getBody().getNamespaceURI(), soapVersion
+                            .getBody().getLocalPart(), soapVersion
+                            .getPrefix()));
+            soapEnv.appendChild(soapBody);
+            Element body = getBodyElement(message);
+            
+            if (body != null) {
+                soapBody.appendChild(soapBody.getOwnerDocument().importNode(body,
+                    true));
             }
-            return;
-        }
-        
-        BindingOperationInfo wsdlOperation = getOperation(message);
-        BindingMessageInfo wsdlMessage = !isRequestor(message) ? wsdlOperation.getInput() : wsdlOperation.getOutput();
+        } else {
 
-        Document document = DomUtil.createDocument();
-        Element root = DomUtil.createElement(document, JbiConstants.WSDL11_WRAPPER_MESSAGE);
-        String typeNamespace = wsdlMessage.getMessageInfo().getName().getNamespaceURI();
-        if (typeNamespace == null || typeNamespace.length() == 0) {
-            throw new IllegalArgumentException("messageType namespace is null or empty");
-        }
-        root.setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + JbiConstants.WSDL11_WRAPPER_MESSAGE_PREFIX,
-                          typeNamespace);
-        String typeLocalName = wsdlMessage.getMessageInfo().getName().getLocalPart();
-        if (typeLocalName == null || typeLocalName.length() == 0) {
-            throw new IllegalArgumentException("messageType local name is null or empty");
-        }
-        root.setAttribute(JbiConstants.WSDL11_WRAPPER_TYPE, JbiConstants.WSDL11_WRAPPER_MESSAGE_PREFIX + ":" + typeLocalName);
-        String messageName = wsdlMessage.getMessageInfo().getName().getLocalPart();
-        root.setAttribute(JbiConstants.WSDL11_WRAPPER_NAME, messageName);
-        root.setAttribute(JbiConstants.WSDL11_WRAPPER_VERSION, "1.0");
-        
-        SoapBindingInfo binding = (SoapBindingInfo) message.getExchange().get(Endpoint.class).getEndpointInfo().getBinding();
-        String style = binding.getStyle(wsdlOperation.getOperationInfo());
-        if (style == null) {
-            style = binding.getStyle();
-        }
-
-        
-        Element body = getBodyElement(message);
-        if (body == null) {
-            return;
-        }
-        
-        if (body.getLocalName().equals("Fault")) {
-            handleJBIFault(message, body);
-            return;
-        }
-        List<SoapHeaderInfo> headers = wsdlMessage.getExtensors(SoapHeaderInfo.class);
-        List<Header> headerElement = message.getHeaders();
-        List<Object> parts = new ArrayList<Object>();
-        for (MessagePartInfo part : wsdlMessage.getMessageParts()) {
-            if ("document".equals(style)) {
-                parts.add(body);
-            } else /* rpc-style */ {
-                // SOAP:Body element is the operation name, children are operation parameters
-                
-                Element param = DomUtil.getFirstChildElement(body);
-                boolean found = false;
-                while (param != null) {
-                    if (part.getName().getLocalPart().equals(param.getLocalName())) {
-                        found = true;
-                        parts.add(wrapNodeList(param.getChildNodes()));
-                        break;
+            BindingOperationInfo wsdlOperation = getOperation(message);
+            BindingMessageInfo wsdlMessage = !isRequestor(message) ? wsdlOperation
+                    .getInput()
+                    : wsdlOperation.getOutput();
+
+            document = DomUtil.createDocument();
+            Element root = DomUtil.createElement(document,
+                    JbiConstants.WSDL11_WRAPPER_MESSAGE);
+            String typeNamespace = wsdlMessage.getMessageInfo().getName()
+                    .getNamespaceURI();
+            if (typeNamespace == null || typeNamespace.length() == 0) {
+                throw new IllegalArgumentException(
+                        "messageType namespace is null or empty");
+            }
+            root
+                    .setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":"
+                            + JbiConstants.WSDL11_WRAPPER_MESSAGE_PREFIX,
+                            typeNamespace);
+            String typeLocalName = wsdlMessage.getMessageInfo().getName()
+                    .getLocalPart();
+            if (typeLocalName == null || typeLocalName.length() == 0) {
+                throw new IllegalArgumentException(
+                        "messageType local name is null or empty");
+            }
+            root.setAttribute(JbiConstants.WSDL11_WRAPPER_TYPE,
+                    JbiConstants.WSDL11_WRAPPER_MESSAGE_PREFIX + ":"
+                            + typeLocalName);
+            String messageName = wsdlMessage.getMessageInfo().getName()
+                    .getLocalPart();
+            root.setAttribute(JbiConstants.WSDL11_WRAPPER_NAME, messageName);
+            root.setAttribute(JbiConstants.WSDL11_WRAPPER_VERSION, "1.0");
+
+            SoapBindingInfo binding = (SoapBindingInfo) message.getExchange()
+                    .get(Endpoint.class).getEndpointInfo().getBinding();
+            String style = binding.getStyle(wsdlOperation.getOperationInfo());
+            if (style == null) {
+                style = binding.getStyle();
+            }
+
+            Element body = getBodyElement(message);
+            if (body == null) {
+                return;
+            }
+
+            if (body.getLocalName().equals("Fault")) {
+                handleJBIFault(message, body);
+                return;
+            }
+            List<SoapHeaderInfo> headers = wsdlMessage
+                    .getExtensors(SoapHeaderInfo.class);
+            List<Header> headerElement = message.getHeaders();
+            List<Object> parts = new ArrayList<Object>();
+            for (MessagePartInfo part : wsdlMessage.getMessageParts()) {
+                if ("document".equals(style)) {
+                    parts.add(body);
+                } else /* rpc-style */ {
+                    // SOAP:Body element is the operation name, children are
+                    // operation parameters
+
+                    Element param = DomUtil.getFirstChildElement(body);
+                    boolean found = false;
+                    while (param != null) {
+                        if (part.getName().getLocalPart().equals(
+                                param.getLocalName())) {
+                            found = true;
+                            parts.add(wrapNodeList(param.getChildNodes()));
+                            break;
+                        }
+                        param = DomUtil.getNextSiblingElement(param);
+                    }
+                    if (!found) {
+                        throw new Fault(new Exception("Missing part '"
+                                + part.getName() + "'"));
                     }
-                    param = DomUtil.getNextSiblingElement(param);
-                }
-                if (!found) {
-                    throw new Fault(new Exception("Missing part '" + part.getName() + "'"));
                 }
             }
-        }
-        processHeader(message, headers, headerElement, parts);
-        for (Object part : parts) {
-            if (part instanceof Node) {
-                addPart(root, (Node) part);
-            } else if (part instanceof NodeList) {
-                addPart(root, (NodeList) part);
-            } else if (part instanceof SoapHeader) {
-                addPart(root, (Node)((SoapHeader)part).getObject());
+            processHeader(message, headers, headerElement, parts);
+            for (Object part : parts) {
+                if (part instanceof Node) {
+                    addPart(root, (Node) part);
+                } else if (part instanceof NodeList) {
+                    addPart(root, (NodeList) part);
+                } else if (part instanceof SoapHeader) {
+                    addPart(root, (Node) ((SoapHeader) part).getObject());
+                }
             }
         }
-        
         message.setContent(Source.class, new DOMSource(document));
     }
 
-    private void processHeader(SoapMessage message, List<SoapHeaderInfo> headers, List<Header> headerElement, List<Object> parts) {
+    private void processHeader(SoapMessage message,
+            List<SoapHeaderInfo> headers, List<Header> headerElement,
+            List<Object> parts) {
         if (headers != null) {
             for (SoapHeaderInfo header : headers) {
                 MessagePartInfo part = header.getPart();
@@ -161,8 +195,9 @@
                 QName element = part.getElementQName();
                 Header hdr = getHeaderElement(message, element);
                 if (hdr == null) {
-                    throw new Fault(new Exception("Missing required header element: "
-                                + QNameUtil.toString(element)));
+                    throw new Fault(new Exception(
+                            "Missing required header element: "
+                                    + QNameUtil.toString(element)));
                 }
                 if (idx > parts.size()) {
                     parts.add(param);
@@ -177,9 +212,17 @@
 
     private void handleJBIFault(SoapMessage message, Element soapFault) {
         Document doc = DomUtil.createDocument();
-        
-        Element jbiFault = DomUtil.createElement(doc, new QName(JBIConstants.NS_JBI_BINDING, JBIFault.JBI_FAULT_ROOT));
-        Node jbiFaultDetail = doc.importNode(soapFault.getElementsByTagName(JBIFault.JBI_FAULT_DETAIL).item(0).getFirstChild(), true);
+
+        Element jbiFault = DomUtil.createElement(doc, new QName(
+                JBIConstants.NS_JBI_BINDING, JBIFault.JBI_FAULT_ROOT));
+        Node jbiFaultDetail = null;
+        if (message.getVersion() instanceof Soap11) {
+            jbiFaultDetail = doc.importNode(soapFault.getElementsByTagName(
+                "detail").item(0).getFirstChild(), true);
+        } else {
+            jbiFaultDetail = doc.importNode(soapFault.getElementsByTagName(
+                    "soap:Detail").item(0).getFirstChild(), true);
+        }
         jbiFault.appendChild(jbiFaultDetail);
         message.setContent(Source.class, new DOMSource(doc));
         message.put("jbiFault", true);
@@ -190,6 +233,7 @@
             public int getLength() {
                 return childNodes.getLength();
             }
+
             public Node item(int index) {
                 return childNodes.item(index);
             }
@@ -197,9 +241,11 @@
     }
 
     protected BindingOperationInfo getOperation(Message message) {
-        BindingOperationInfo operation = message.getExchange().get(BindingOperationInfo.class);
+        BindingOperationInfo operation = message.getExchange().get(
+                BindingOperationInfo.class);
         if (operation == null) {
-            throw new Fault(new Exception("Operation not bound on this message"));
+            throw new Fault(
+                    new Exception("Operation not bound on this message"));
         }
         return operation;
     }
@@ -209,17 +255,16 @@
      */
     protected Element getBodyElement(SoapMessage message) {
         try {
-            XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class);
-            XMLStreamReader filteredReader = new PartialXMLStreamReader(xmlReader, message.getVersion().getBody());
-            Document doc = StaxUtils.read(filteredReader);
-            return doc.getDocumentElement();
+            XMLStreamReader xmlReader = message
+                    .getContent(XMLStreamReader.class);
+            XMLStreamReader filteredReader = new PartialXMLStreamReader(
+                    xmlReader, message.getVersion().getBody());
+            return StaxUtils.read(filteredReader).getDocumentElement();
         } catch (XMLStreamException e) {
             throw new Fault(e);
         }
     }
-    
-    
-    
+
     protected Header getHeaderElement(SoapMessage message, QName name) {
         Exchange exchange = message.getExchange();
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
@@ -245,39 +290,50 @@
         }
         return null;
     }
-    
+
     /**
      * Add a jbi:part to a normalized message document
      */
     private static void addPart(Element parent, Node partValue) {
-        Element element = DomUtil.createElement(parent, JbiConstants.WSDL11_WRAPPER_PART);
-        element.appendChild(element.getOwnerDocument().importNode(partValue, true));
+        Element element = DomUtil.createElement(parent,
+                JbiConstants.WSDL11_WRAPPER_PART);
+        element.appendChild(element.getOwnerDocument().importNode(partValue,
+                true));
     }
 
     /**
      * Add a jbi:part to a normalized message document
      */
     private static void addPart(Element parent, NodeList nodes) {
-        Element element = DomUtil.createElement(parent, JbiConstants.WSDL11_WRAPPER_PART);
+        Element element = DomUtil.createElement(parent,
+                JbiConstants.WSDL11_WRAPPER_PART);
         for (int i = 0; i < nodes.getLength(); i++) {
             Node node = nodes.item(i);
-            element.appendChild(element.getOwnerDocument().importNode(node, true));
+            element.appendChild(element.getOwnerDocument().importNode(node,
+                    true));
         }
     }
 
-    private static Header findHeader(List<Header> headerElement, MessagePartInfo mpi) {
+    private static Header findHeader(List<Header> headerElement,
+            MessagePartInfo mpi) {
         Header param = null;
         if (headerElement != null) {
             QName name = mpi.getConcreteName();
             for (Header header : headerElement) {
-                if (header.getName().getNamespaceURI() != null 
-                        && header.getName().getNamespaceURI().equals(name.getNamespaceURI())
+                if (header.getName().getNamespaceURI() != null
+                        && header.getName().getNamespaceURI().equals(
+                                name.getNamespaceURI())
                         && header.getName().getLocalPart() != null
-                        && header.getName().getLocalPart().equals(name.getLocalPart())) {
+                        && header.getName().getLocalPart().equals(
+                                name.getLocalPart())) {
                     param = header;
                 }
             }
         }
         return param;
+    }
+    
+    protected boolean isRequestor(Message message) {
+        return Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE));
     }
 }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.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/JbiOperationInterceptor.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/interceptors/JbiOperationInterceptor.java Mon Mar 10 21:24:57 2008
@@ -34,8 +34,10 @@
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
 import org.apache.cxf.staxutils.StaxUtils;
 
+
 public class JbiOperationInterceptor extends AbstractPhaseInterceptor<Message> {
 
+        
     public JbiOperationInterceptor() {
         super(Phase.UNMARSHAL);
         addAfter(URIMappingInterceptor.class.getName());
@@ -48,7 +50,9 @@
         if (message.getExchange().get(BindingOperationInfo.class) != null) {
             return;
         }
+        
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
+        
         BindingOperationInfo operation = null;
         if (!StaxUtils.toNextElement(xmlReader)) {
             message.setContent(Exception.class, new RuntimeException(
@@ -90,6 +94,7 @@
     }
 
     protected DepthXMLStreamReader getXMLStreamReader(Message message) {
+        
         XMLStreamReader xr = message.getContent(XMLStreamReader.class);
         if (xr instanceof DepthXMLStreamReader) {
             return (DepthXMLStreamReader) xr;

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=635798&r1=635797&r2=635798&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 Mon Mar 10 21:24:57 2008
@@ -29,6 +29,7 @@
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
@@ -46,13 +47,19 @@
 import org.apache.servicemix.soap.interceptors.jbi.JbiConstants;
 import org.apache.servicemix.soap.util.DomUtil;
 
+
+
+
 /**
  * @author <a href="mailto:gnodet [at] gmail.com">Guillaume Nodet</a>
  */
 public class JbiOutWsdl1Interceptor extends AbstractSoapInterceptor {
-
-    public JbiOutWsdl1Interceptor() {
+    
+    private boolean useJBIWrapper = true;
+    
+    public JbiOutWsdl1Interceptor(boolean useJBIWrapper) {
         super(Phase.MARSHAL);
+        this.useJBIWrapper = useJBIWrapper;
     }
 
     public void handleMessage(SoapMessage message) {
@@ -61,7 +68,24 @@
             if (source == null) {
                 return;
             }
+            
             Element element = new SourceTransformer().toDOMElement(source);
+            XMLStreamWriter xmlWriter = message
+                .getContent(XMLStreamWriter.class);
+            
+            if (!useJBIWrapper) {
+                SoapVersion soapVersion = message.getVersion();
+                if (element != null) {
+                    element = (Element) element.getElementsByTagNameNS(
+                            element.getNamespaceURI(),
+                            soapVersion.getBody().getLocalPart()).item(0);
+                    if (element != null) {
+                        StaxUtils.writeElement((Element)element.getFirstChild(), xmlWriter, false);
+                    }
+                }
+                return;
+            }
+            
             if (!JbiConstants.WSDL11_WRAPPER_NAMESPACE.equals(element
                     .getNamespaceURI())
                     || !JbiConstants.WSDL11_WRAPPER_MESSAGE_LOCALNAME
@@ -76,9 +100,7 @@
             BindingMessageInfo msg = isRequestor(message) ? bop.getInput()
                     : bop.getOutput();
 
-            XMLStreamWriter xmlWriter = message
-                    .getContent(XMLStreamWriter.class);
-
+            
             SoapBindingInfo binding = (SoapBindingInfo) message.getExchange()
                     .get(Endpoint.class).getEndpointInfo().getBinding();
             String style = binding.getStyle(bop.getOperationInfo());
@@ -113,6 +135,8 @@
         }
     }
 
+    
+    
     private void getRPCPartWrapper(BindingMessageInfo msg, 
                                    Element element,
                                    SoapMessage message, 

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.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/CxfBCSESystemTest.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBCSESystemTest.java Mon Mar 10 21:24:57 2008
@@ -17,25 +17,87 @@
 package org.apache.servicemix.cxfbc;
 
 import java.net.URL;
+import java.util.logging.Logger;
+
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.calculator.AddNumbersFault;
 import org.apache.cxf.calculator.CalculatorPortType;
 import org.apache.cxf.calculator.CalculatorService;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
 
+import org.apache.servicemix.jbi.container.SpringJBIContainer;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.tck.SpringTestSupport;
 import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
 import org.springframework.context.support.AbstractXmlApplicationContext;
 
 public class CxfBCSESystemTest extends SpringTestSupport {
+    
+    private static final Logger LOG = LogUtils.getL7dLogger(CxfBCSESystemTest.class);
+    public void setUp() throws Exception {
+        //override super setup
+        LOG.info("setUp is invoked");
+    }
+    
+    public void setUpJBI(String beanFile) throws Exception {
+        if (context != null) {
+            context.refresh();
+        }
+        transformer = new SourceTransformer();
+        if (beanFile == null) {
+            context = createBeanFactory();
+        } else {
+            context = createBeanFactory(beanFile);
+        }
+                
+        jbi = (SpringJBIContainer) context.getBean("jbi");
+        assertNotNull("JBI Container not found in spring!", jbi);
+    }
+    
+    public void tearDown() throws Exception {
+        if (context != null) {
+            context.destroy();
+            context = null;
+        }
+        if (jbi != null) {
+            jbi.shutDown();
+            jbi.destroy();
+            jbi = null;
+        }
+    }
 
-    public void testCalculator() throws Exception {
+    public void testCalculatrorWithJBIWrapper() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/xbean.xml");
+        calculatorTestBase();
+    }
+    
+    public void testCalculatrorWithOutJBIWrapper() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml");
+        calculatorTestBase();
+    }
+    
+    public void testMultipleClientWithJBIWrapper() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/xbean.xml");
+        multiClientTestBase();
+    }
+    
+    public void testMultipleClientWithoutJBIWrapper() throws Exception {
+        setUpJBI("org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml");
+        multiClientTestBase();
+    }
+    
+    private void calculatorTestBase() throws Exception {
 
         URL wsdl = getClass().getResource("/wsdl/calculator.wsdl");
         assertNotNull(wsdl);
         CalculatorService service = new CalculatorService(wsdl, new QName(
                 "http://apache.org/cxf/calculator", "CalculatorService"));
         CalculatorPortType port = service.getCalculatorPort();
+        ClientProxy.getClient(port).getInFaultInterceptors().add(new LoggingInInterceptor());
+        ClientProxy.getClient(port).getInInterceptors().add(new LoggingInInterceptor());
         int ret = port.add(1, 2);
         assertEquals(ret, 3);
         try {
@@ -47,7 +109,7 @@
         }
     }
     
-    public void testMultiClient() throws Exception {
+    private void multiClientTestBase() throws Exception {
         URL wsdl = getClass().getResource("/wsdl/calculator.wsdl");
         assertNotNull(wsdl);
         CalculatorService service = new CalculatorService(wsdl, new QName(
@@ -89,6 +151,12 @@
         // load cxf se and bc from spring config file
         return new ClassPathXmlApplicationContext(
                 "org/apache/servicemix/cxfbc/xbean.xml");
+    }
+    
+    protected AbstractXmlApplicationContext createBeanFactory(String beanFile) {
+        //load cxf se and bc from specified spring config file
+        return new ClassPathXmlApplicationContext(
+            beanFile);
     }
 
 }

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.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/CxfBcProviderConsumerTest.java?rev=635798&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java Mon Mar 10 21:24:57 2008
@@ -0,0 +1,75 @@
+/*
+ * 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;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.calculator.CalculatorImpl;
+import org.apache.cxf.calculator.CalculatorPortType;
+import org.apache.cxf.calculator.CalculatorService;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class CxfBcProviderConsumerTest extends SpringTestSupport {
+
+    public void testBridge() throws Exception {
+        
+        URL wsdl = getClass().getResource("/wsdl/calculator.wsdl");
+        // start external service
+        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
+        factory.setServiceClass(CalculatorPortType.class);
+        factory.setServiceBean(new CalculatorImpl());
+        factory.setWsdlURL(wsdl.toString());
+        factory.setServiceName(new QName("http://apache.org/cxf/calculator", 
+                "CalculatorService"));
+        factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/");
+        String address = "http://localhost:9001/bridgetest";
+        factory.setAddress(address);
+        Server server = factory.create();
+        Endpoint endpoint = server.getEndpoint();
+        endpoint.getInInterceptors().add(new LoggingInInterceptor());
+        endpoint.getOutInterceptors().add(new LoggingOutInterceptor());
+        ServiceInfo service = endpoint.getEndpointInfo().getService();
+        assertNotNull(service);
+
+        // start external client
+        
+        assertNotNull(wsdl);
+        CalculatorService service1 = new CalculatorService(wsdl, new QName(
+                "http://apache.org/cxf/calculator", "CalculatorService"));
+        CalculatorPortType port = service1.getCalculatorPort();
+        int ret = port.add(1, 2);
+        assertEquals(ret, 3);
+
+    }
+
+    @Override
+    protected AbstractXmlApplicationContext createBeanFactory() {
+        return new ClassPathXmlApplicationContext(
+                "org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml");
+    }
+
+}

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.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/CxfBcProviderTest.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java Mon Mar 10 21:24:57 2008
@@ -72,6 +72,7 @@
         factory.setServiceBean(new CalculatorImpl());
         String address = "http://localhost:9001/providertest";
         factory.setAddress(address);
+        factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/");
         Server server = factory.create();
         Endpoint endpoint = server.getEndpoint();
         endpoint.getInInterceptors().add(new LoggingInInterceptor());

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.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/cxf_provider_consumer_bridge.xml?rev=635798&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml Mon Mar 10 21:24:57 2008
@@ -0,0 +1,70 @@
+<?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:calculator="http://apache.org/cxf/calculator">
+  
+  <sm:container id="jbi" embedded="true">
+    
+    <sm:endpoints>
+      <cxfbc:consumer wsdl="/wsdl/calculator.wsdl"
+                      service="calculator:CalculatorService"
+                      endpoint="CalculatorPort"
+                      targetEndpoint="CalculatorPortProxy"
+                      targetService="calculator:CalculatorService"
+                      targetInterface="calculator:CalculatorPortType">
+          <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/calculator.wsdl"
+                      locationURI="http://localhost:9001/bridgetest"
+                      service="calculator:CalculatorService"
+                      endpoint="CalculatorPortProxy"
+                      interfaceName="calculator:CalculatorPortType"
+                     >
+          <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:provider> 
+    </sm:endpoints>
+    
+  </sm:container>
+  
+</beans>

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.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/xbean_without_jbi_wrapper.xml?rev=635798&view=auto
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml (added)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml Mon Mar 10 21:24:57 2008
@@ -0,0 +1,69 @@
+<?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:cxfse="http://servicemix.apache.org/cxfse/1.0"
+       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
+       xmlns:test="urn:test"
+       xmlns:calculator="http://apache.org/cxf/calculator">
+  
+  <sm:container id="jbi" embedded="true">
+    
+    <sm:endpoints>
+      <cxfse:endpoint useJBIWrapper="false">
+        <cxfse:pojo>
+          <bean class="org.apache.cxf.calculator.CalculatorImpl" />
+        </cxfse:pojo>
+        <cxfse:inInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inInterceptors>
+        <cxfse:outInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outInterceptors>
+        <cxfse:inFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inFaultInterceptors>
+        <cxfse:outFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outFaultInterceptors>
+      </cxfse:endpoint>
+      <cxfbc:consumer wsdl="/wsdl/calculator.wsdl"
+                      targetEndpoint="CalculatorPort"
+                      targetService="calculator:CalculatorService"
+                      targetInterface="calculator:CalculatorPortType"
+                      useJBIWrapper="false"
+                      >
+        <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>
+    </sm:endpoints>
+    
+  </sm:container>
+  
+</beans>

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeEndpoint.java Mon Mar 10 21:24:57 2008
@@ -80,6 +80,8 @@
     
     private boolean mtomEnabled;
     
+    private boolean useJBIWrapper = true;
+    
     
     /**
      * @return the pojo
@@ -151,7 +153,9 @@
         serviceFactory.setPopulateFromClass(true);
         endpoint = new EndpointImpl(getBus(), getPojo(),
                 new JaxWsServerFactoryBean(serviceFactory));
-        endpoint.setBindingUri(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
+        if (isUseJBIWrapper()) {
+            endpoint.setBindingUri(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
+        }
         endpoint.setInInterceptors(getInInterceptors());
         endpoint.setInFaultInterceptors(getInFaultInterceptors());
         endpoint.setOutInterceptors(getOutInterceptors());
@@ -281,5 +285,13 @@
 
     public boolean isMtomEnabled() {
         return mtomEnabled;
+    }
+
+    public void setUseJBIWrapper(boolean useJBIWrapper) {
+        this.useJBIWrapper = useJBIWrapper;
+    }
+
+    public boolean isUseJBIWrapper() {
+        return useJBIWrapper;
     }
 }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeProxyFactoryBean.java?rev=635798&r1=635797&r2=635798&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeProxyFactoryBean.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeProxyFactoryBean.java Mon Mar 10 21:24:57 2008
@@ -65,6 +65,8 @@
     private boolean propagateSecuritySubject;
 
     private ServiceMixClient client;
+    
+    private boolean useJBIWrapper = true;
 
     public Object getObject() throws Exception {
         if (proxy == null) {
@@ -78,7 +80,9 @@
         cf.setServiceName(getService());
         cf.setServiceClass(type);
         cf.setAddress("jbi://" + new IdGenerator().generateSanitizedId());
-        cf.setBindingId(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
+        if (isUseJBIWrapper()) {
+            cf.setBindingId(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
+        }
         Bus bus = BusFactory.getDefaultBus();
         JBITransportFactory jbiTransportFactory = (JBITransportFactory) bus
                 .getExtension(ConduitInitiatorManager.class)
@@ -233,6 +237,14 @@
             client.close();
             client = null;
         }
+    }
+
+    public void setUseJBIWrapper(boolean useJBIWrapper) {
+        this.useJBIWrapper = useJBIWrapper;
+    }
+
+    public boolean isUseJBIWrapper() {
+        return useJBIWrapper;
     }
 
 }