cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r453355 [1/3] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/service/ api/src/main/java/org/apache/cxf/service/model/ api/src/main/java/org/apache/cxf/transport/ rt/bindings/soap/src/main...
Date Thu, 05 Oct 2006 20:19:56 GMT
Author: dandiep
Date: Thu Oct  5 13:19:52 2006
New Revision: 453355

URL: http://svn.apache.org/viewvc?view=rev&rev=453355
Log:
svn-commit.tmp

Added:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLEndpointFactory.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsEndpointProxyFactoryBean.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterGetFaultMessage.xml
      - copied unchanged from r450257, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/GreeterGetFaultMessage.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterMessage.xml
      - copied unchanged from r450257, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/GreeterMessage.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java
      - copied, changed from r450257, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/GreeterTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
      - copied, changed from r450257, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/SoapFaultTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/PayloadProvider.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/ProviderTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/sayHi.xml   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java   (with props)
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/JaxWsMethodDispatcher.java   (props changed)
      - copied unchanged from r450257, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsMethodDispatcher.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ServerFactoryBean.java   (with props)
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java   (with props)
Removed:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsMethodDispatcher.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/GreeterGetFaultMessage.xml
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/GreeterMessage.xml
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/GreeterTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/SoapFaultTest.java
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactoryManager.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/Messages.properties
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java
    incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
    incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java
    incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/XPathAssert.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/ConduitInitiatorManagerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/DestinationFactoryManagerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/Messages.properties
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/ServiceWSDLBuilderTest.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBServiceModelInitializer.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/MessageDataReader.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBeanTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractBindingInfoFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SoapBindingInfoFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPTransportFactory.java
    incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml
    incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml
    incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/bus/SpringBusFactoryTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerXMLBareTest.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Thu Oct  5 13:19:52 2006
@@ -134,6 +134,7 @@
                 if (LOG.isLoggable(Level.INFO)) {
                     LogUtils.log(LOG, Level.INFO, "Interceptor has thrown exception, unwinding now", ex);
                 }
+                ex.printStackTrace();
                 message.setContent(Exception.class, ex);
                 unwind(message);
                 

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/Service.java Thu Oct  5 13:19:52 2006
@@ -25,6 +25,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.InterceptorProvider;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.ServiceInfo;
@@ -46,4 +47,6 @@
     Invoker getInvoker();
     
     void setInvoker(Invoker invoker);
+    
+    Map<QName, Endpoint> getEndpoints();
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java Thu Oct  5 13:19:52 2006
@@ -123,7 +123,8 @@
 
     public BindingOperationInfo getOperation(OperationInfo oi) {
         for (BindingOperationInfo b : operations.values()) {
-            if (b.getOperationInfo() == oi || b.getUnwrappedOperation().getOperationInfo() == oi) {
+            if (b.getOperationInfo() == oi 
+                || (b.isUnwrappedCapable() && b.getUnwrappedOperation().getOperationInfo() == oi)) {
                 return b;
             }
         }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java Thu Oct  5 13:19:52 2006
@@ -19,25 +19,21 @@
 
 package org.apache.cxf.service.model;
 
-import javax.wsdl.extensions.http.HTTPAddress;
-import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.xml.namespace.QName;
 
-import org.xmlsoap.schemas.wsdl.http.AddressType;
-
 public class EndpointInfo extends AbstractPropertiesHolder {
-    final String endpointType;
+    final String transportId;
     ServiceInfo service;
     BindingInfo binding;
     QName name;
     String address;
     
     public EndpointInfo(ServiceInfo serv, String ns) {
-        endpointType = ns;
+        transportId = ns;
         service = serv;
     }
     public String getTransportId() {
-        return endpointType;
+        return transportId;
     }    
     public InterfaceInfo getInterface() {
         return service.getInterface();
@@ -61,23 +57,9 @@
     }    
     
     public String getAddress() {
-        if (null != address) {
-            return address;
-        }
-        SOAPAddress sa = getExtensor(SOAPAddress.class);
-        if (null != sa) {
-            return sa.getLocationURI();
-        }
-        HTTPAddress ha = getExtensor(HTTPAddress.class);
-        if (null != ha) {
-            return ha.getLocationURI();
-        }
-        AddressType a = getExtensor(AddressType.class);
-        if (null != a) {
-            return a.getLocation();
-        }
-        return null;
+        return address;
     }
+    
     public void setAddress(String a) {
         address = a;
     }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java Thu Oct  5 13:19:52 2006
@@ -47,6 +47,14 @@
         pname = n;
     }
     
+    public QName getConcreteName() {
+        if (isElement) {
+            return typeName;
+        } else {
+            return pname;
+        }
+    }
+    
     public boolean isElement() { 
         return isElement;
     }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java Thu Oct  5 13:19:52 2006
@@ -42,7 +42,6 @@
     String outName;
     MessageInfo outputMessage;
     Map<QName, FaultInfo> faults;
-    
     OperationInfo unwrappedOperation;
     
     public OperationInfo() {
@@ -119,6 +118,7 @@
     public boolean isUnwrappedCapable() {
         return unwrappedOperation != null;
     }
+    
     public OperationInfo getUnwrappedOperation() {
         return unwrappedOperation;
     }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java Thu Oct  5 13:19:52 2006
@@ -39,7 +39,15 @@
     }
     
     public static BindingOperationInfo getOperation(Exchange exchange, String opName) {
-        return getOperation(exchange, new QName(getTargetNamespace(exchange), opName));
+        Endpoint ep = exchange.get(Endpoint.class);
+        BindingInfo service = ep.getEndpointInfo().getBinding();
+        
+        for (BindingOperationInfo b : service.getOperations()) {
+            if (b.getName().getLocalPart().equals(opName)) {
+                return b;
+            }
+        }
+        return null;
     }
 
     public static BindingOperationInfo getOperation(Exchange exchange, QName opName) {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactoryManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactoryManager.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactoryManager.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/transport/DestinationFactoryManager.java Thu Oct  5 13:19:52 2006
@@ -52,4 +52,5 @@
      * @throws BusException
      */
     DestinationFactory getDestinationFactory(String name) throws BusException;
+
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java Thu Oct  5 13:19:52 2006
@@ -20,41 +20,67 @@
 package org.apache.cxf.binding.soap;
 
 import java.io.IOException;
-
-import javax.wsdl.WSDLException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.wsdl.Port;
 import javax.wsdl.extensions.soap.SOAPAddress;
 
+import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
+
+import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.DestinationFactory;
 import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.ws.addressing.AttributedURIType;
-import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.wsdl11.WSDLEndpointFactory;
 
-public class SoapDestinationFactory implements DestinationFactory {
+public class SoapDestinationFactory implements DestinationFactory, WSDLEndpointFactory {
     private DestinationFactoryManager destinationFactoryManager;
+
+    private Bus bus;
+    private Collection<String> activationNamespaces;
+    
+    public SoapDestinationFactory() {
+        super();
+    }
     
     public SoapDestinationFactory(DestinationFactoryManager destinationFactoyrManager) {
         super();
         this.destinationFactoryManager = destinationFactoyrManager;
     }
 
+    
+    @Resource
+    public void setBus(Bus b) {
+        bus = b;
+    }
+    
+    @PostConstruct
+    void register() {
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        this.destinationFactoryManager = dfm;
+        if (null != dfm) {
+            for (String ns : activationNamespaces) {
+                dfm.registerDestinationFactory(ns, this);
+            }
+        }
+    }
+    
     public Destination getDestination(EndpointInfo ei) throws IOException {
-        EndpointReferenceType epr = new EndpointReferenceType();
-        AttributedURIType uri = new AttributedURIType();
-        
-        // TODO: make non wsdl4j specific
-        SOAPAddress add = ei.getExtensor(SOAPAddress.class);
-        uri.setValue(add.getLocationURI());
-        epr.setAddress(uri);
-        
-        SoapBindingInfo binding = (SoapBindingInfo) ei.getBinding();
+        SoapBindingInfo binding = (SoapBindingInfo)ei.getBinding();
         DestinationFactory destinationFactory;
         try {
             destinationFactory = destinationFactoryManager.getDestinationFactory(binding.getTransportURI());
-            
+
             return destinationFactory.getDestination(ei);
         } catch (BusException e) {
             throw new RuntimeException("Could not find destination factory for transport "
@@ -62,16 +88,44 @@
         }
     }
 
-    public Destination getDestination(EndpointReferenceType reference) throws WSDLException, IOException {
-        // TODO How do we get actual destination factory??
-        throw new UnsupportedOperationException();
+    public void createPortExtensors(EndpointInfo ei, Service service) {
+        SOAPAddress address = new SOAPAddressImpl();
+        address.setLocationURI(ei.getAddress());
+        address.setRequired(Boolean.TRUE);
+
+        ei.addExtensor(address);
+    }
+
+    public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port port) {
+        List ees = port.getExtensibilityElements();
+        for (Iterator itr = ees.iterator(); itr.hasNext();) {
+            Object extensor = itr.next();
+
+            if (extensor instanceof SOAPAddress) {
+                SOAPAddress sa = (SOAPAddress)extensor;
+
+                SoapBindingInfo sbi = (SoapBindingInfo) b;
+                EndpointInfo info = new EndpointInfo(serviceInfo, sbi.getTransportURI());
+                info.setAddress(sa.getLocationURI());
+                return info;
+            }
+        }
+
+        return null;
     }
 
     public DestinationFactoryManager getDestinationFactoryManager() {
         return destinationFactoryManager;
     }
 
+    @Resource
     public void setDestinationFactoryManager(DestinationFactoryManager destinationFactoryManager) {
         this.destinationFactoryManager = destinationFactoryManager;
     }
+
+    @Resource
+    public void setActivationNamespaces(Collection<String> activationNamespaces) {
+        this.activationNamespaces = activationNamespaces;
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml Thu Oct  5 13:19:52 2006
@@ -23,5 +23,11 @@
         <namespace>http://schemas.xmlsoap.org/wsdl/soap/</namespace>
         <namespace>http://schemas.xmlsoap.org/wsdl/soap/http</namespace>
         <namespace>http://cxf.apache.org/transports/jms</namespace>
+    </extension>
+    
+    <extension class="org.apache.cxf.binding.soap.SoapDestinationFactory" 
+      interface="org.apache.cxf.transport.DestinationFactory" deferred="true">
+        <namespace>http://schemas.xmlsoap.org/soap/</namespace>
+        <namespace>http://schemas.xmlsoap.org/wsdl/soap/</namespace>
     </extension>    
 </extensions>

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml Thu Oct  5 13:19:52 2006
@@ -31,9 +31,22 @@
         </property>
         <property name="activationNamespaces">
             <set>
+                <value>http://schemas.xmlsoap.org/soap/</value>
                 <value>http://schemas.xmlsoap.org/wsdl/soap/</value>
                 <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
                 <value>http://cxf.apache.org/transports/jms</value>
+            </set>
+        </property>
+    </bean>
+    
+    <bean class="org.apache.cxf.binding.soap.SoapDestinationFactory" lazy-init="true">
+        <property name="bus">
+            <ref bean="cxf"/>
+        </property>
+        <property name="activationNamespaces">
+            <set>
+                <value>http://schemas.xmlsoap.org/soap/</value>
+                <value>http://schemas.xmlsoap.org/wsdl/soap/</value>
             </set>
         </property>
     </bean>

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ServiceModelUtilTest.java Thu Oct  5 13:19:52 2006
@@ -38,10 +38,13 @@
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
+import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
+import static org.easymock.EasyMock.expect;
+
 public class ServiceModelUtilTest extends TestCase {
     private static final String WSDL_PATH = "test-soap-header.wsdl";
     private Definition def;
@@ -73,6 +76,9 @@
         wsdlServiceBuilder = new WSDLServiceBuilder(bus);
 
         EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bindingFactoryManager);
+
+        DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
+        expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
 
         control.replay();
         serviceInfo = wsdlServiceBuilder.buildService(def, service);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java Thu Oct  5 13:19:52 2006
@@ -41,6 +41,7 @@
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.easymock.IMocksControl;
 
@@ -60,6 +61,10 @@
         bfm.registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
 
         expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bfm);
+        
+        DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
+        expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
+        
         control.replay();
 
         WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java Thu Oct  5 13:19:52 2006
@@ -47,6 +47,7 @@
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -119,6 +120,7 @@
         IMocksControl control = EasyMock.createNiceControl();
         Bus bus = control.createMock(Bus.class);
         BindingFactoryManager bindingFactoryManager = control.createMock(BindingFactoryManager.class);
+        DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
         WSDLServiceBuilder wsdlServiceBuilder = new WSDLServiceBuilder(bus);
 
         Service service = null;
@@ -131,6 +133,7 @@
         }
 
         EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bindingFactoryManager);
+        EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
         control.replay();
 
         ServiceInfo serviceInfo = wsdlServiceBuilder.buildService(def, service);

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/Messages.properties?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/Messages.properties (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/Messages.properties Thu Oct  5 13:19:52 2006
@@ -5,4 +5,5 @@
 NO_OPERATION=No such operation: {0}
 NO_DATAREADER=No DataReader is available for Service: {0}
 NO_DATAWRITER=No DataWriter is available for Service: {0}
-COULD_NOT_UNRWAP=Could not unrwap message parts.
\ No newline at end of file
+COULD_NOT_UNRWAP=Could not unrwap message parts.
+REQ_NOT_UNDERSTOOD=Could not read request. Operation is unknown.
\ No newline at end of file

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptor.java Thu Oct  5 13:19:52 2006
@@ -19,34 +19,40 @@
 
 package org.apache.cxf.binding.xml.interceptor;
 
-import java.util.HashMap;
-import java.util.Map;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.ResourceBundle;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 
-import org.apache.cxf.bindings.xformat.XMLBindingMessageFormat;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.BareInInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.WrappedInInterceptor;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingInfo;
-import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.service.model.ServiceModelUtil;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class XMLMessageInInterceptor extends AbstractInDatabindingInterceptor {
 
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WrappedInInterceptor.class);
-
+    
+    // TODO: this should be part of the chain!!
+    private BareInInterceptor bareInterceptor = new BareInInterceptor();
+    private WrappedInInterceptor wrappedInterceptor = new WrappedInInterceptor();
+    
     public XMLMessageInInterceptor() {
         super();
         setPhase(Phase.UNMARSHAL);
@@ -55,98 +61,61 @@
     public void handleMessage(Message message) throws Fault {
 
         XMLStreamReader xsr = message.getContent(XMLStreamReader.class);
-        DepthXMLStreamReader dxsr = new DepthXMLStreamReader(xsr);
+        DepthXMLStreamReader reader = new DepthXMLStreamReader(xsr);
         Endpoint ep = message.getExchange().get(Endpoint.class);
         BindingInfo service = ep.getEndpointInfo().getBinding();
-        Map<Class<?>, Object> objMap = new HashMap<Class<?>, Object>();
-        // StaxUtils.nextEvent(xmlReader);
-        if (!StaxUtils.toNextElement(dxsr)) {
+        
+        if (!StaxUtils.toNextElement(reader)) {
             throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION_ELEMENT", BUNDLE));
         }
-        QName startQName = new QName(dxsr.getNamespaceURI(), dxsr.getLocalName());
-        for (BindingOperationInfo boi : service.getOperations()) {
-            setObjectMap(boi, message, objMap);
-            MessageInfo mi = getObject(MessageInfo.class, objMap);
-            QName rootInModel = getObject(QName.class, objMap);
-            if (rootInModel != null && rootInModel.equals(startQName)) {
-                if (mi.getMessageParts().size() != 1) {
-                    // handle multi param in bare mode
-                    message.getExchange().put(BindingOperationInfo.class, boi);
-                    StaxUtils.nextEvent(dxsr);
-                    StaxUtils.toNextElement(dxsr);
-                    new BareInInterceptor().handleMessage(message);
-                    break;
-                } else {
-                    if (!boi.isUnwrappedCapable()) {
-                        // it's bare with one part and part name equals
-                        // operation name (not support yet)
-                        if (rootInModel.equals(startQName)) {
-                            message.getExchange().put(BindingOperationInfo.class, boi);
-                            new BareInInterceptor().handleMessage(message);
-                            break;
-                        }
-                    } else {
-                        // processing wrap here
-                        message.getExchange().put(BindingOperationInfo.class, boi);
-                        new WrappedInInterceptor().handleMessage(message);
-                        break;
-                    }
-                }
-            } else {
-                // bare with one part and part name not equal operation name,
-                // check param match
-                if (!boi.isUnwrappedCapable()) {
-                    if (mi.getMessageParts().size() != 1) {
-                        continue;
-                    }
-                    if (rootInModel.equals(startQName)) {
-                        message.getExchange().put(BindingOperationInfo.class, boi);
-                        new BareInInterceptor().handleMessage(message);
-                        break;
-                    }
-                }
+        
+        QName startQName = reader.getName();
+        Exchange ex = message.getExchange();
+        BindingOperationInfo bop = ex.get(BindingOperationInfo.class);
+        MessagePartInfo part = null;
+        if (bop == null) {
+            List<OperationInfo> operations = new ArrayList<OperationInfo>();
+            operations.addAll(service.getInterface().getOperations());
+            
+            part = findMessagePart(ex, operations, startQName, false , 0);
+        } else {
+            MessageInfo msgInfo = getMessageInfo(message, bop, ex);
+            if (msgInfo.getMessageParts().size() > 0) {
+                part = msgInfo.getMessageParts().get(0);
             }
         }
-    }
 
-    private <T> T getObject(Class<T> cls, Map<Class<?>, Object> objMap) {
-        return cls.cast(objMap.get(cls));
-    }
-
-    private void setObjectMap(BindingOperationInfo boi, Message message, Map<Class<?>, Object> objMap) {
-        MessageInfo mi;
-        BindingMessageInfo bmi;
-        if (!isRequestor(message)) {
-            mi = boi.getOperationInfo().getInput();
-            bmi = boi.getInput();
-        } else {
-            mi = boi.getOperationInfo().getOutput();
-            bmi = boi.getOutput();
-        }
-        QName paramFirst = null;
-        if (mi.getMessageParts().size() > 0) {
-            MessagePartInfo mpiFirst = mi.getMessagePartByIndex(0);
-            if (mpiFirst.isElement()) {
-                paramFirst = mpiFirst.getElementQName();
+        if (part != null && part.getMessageInfo().getMessageParts().size() == 1) {
+            OperationInfo o = part.getMessageInfo().getOperation();
+            // TODO: We already know the op, so we can optimize BareInInterceptor a bit yet
+            if (!o.isUnwrappedCapable()) {
+                bareInterceptor.handleMessage(message);
+                return;
             } else {
-                // currently this has not been suppoerted by JAXBEncoderDecoder
-                paramFirst = mpiFirst.getTypeQName();
+                wrappedInterceptor.handleMessage(message);
+                return;
             }
-        }
-        QName rootInModel = null;
-        Object ext = bmi.getExtensor(XMLBindingMessageFormat.class);
-        if (ext instanceof XMLBindingMessageFormat) {
-            // it's bare mode method, the root node exist for multi param
-            rootInModel = ((XMLBindingMessageFormat) ext).getRootNode();
         } else {
-            // its wrap mode or bare-single-param mode, using operation name
-            if (mi.getMessageParts().size() == 1) {
-                rootInModel = paramFirst;
+            QName name = new QName(service.getInterface().getName().getNamespaceURI(), 
+                                   "multiParamRootReq");
+            if (reader.getName().equals(name)) {
+                StaxUtils.nextEvent(reader);
+                StaxUtils.toNextElement(reader);
+                bareInterceptor.handleMessage(message);
+                return;
             } else {
-                rootInModel = boi.getName();
+                // Do we have a bare request with no parts?
+                bop = ServiceModelUtil.getOperation(ex, reader.getName());
+                if (bop != null) {
+                    ex.put(BindingOperationInfo.class, bop);
+                    getMessageInfo(message, bop, ex);
+                    message.setContent(List.class, Collections.EMPTY_LIST);
+                    return;
+                }
             }
         }
-        objMap.put(QName.class, rootInModel);
-        objMap.put(MessageInfo.class, mi);
+        
+        throw new Fault(new org.apache.cxf.common.i18n.Message("REQ_NOT_UNDERSTOOD", BUNDLE));
     }
+
 }

Modified: incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java Thu Oct  5 13:19:52 2006
@@ -22,13 +22,9 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.lang.reflect.Method;
-import java.net.URL;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
-import javax.wsdl.Definition;
-import javax.wsdl.Service;
 import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
@@ -52,13 +48,13 @@
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.phase.PhaseInterceptorChain;
-import org.apache.cxf.service.ServiceImpl;
-import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.wsdl.WSDLManager;
 import org.apache.cxf.wsdl11.WSDLManagerImpl;
-import org.apache.cxf.wsdl11.WSDLServiceBuilder;
+import org.apache.cxf.wsdl11.WSDLServiceFactory;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 
@@ -116,48 +112,6 @@
         return null;
     }
 
-    public ServiceInfo getTestService(Class<?> clz) {
-        // FIXME?!?!?!?? There should NOT be JAX-WS stuff here
-        return null;
-    }
-
-    protected BindingInfo getTestService(String wsdlUrl, String port) throws Exception {
-        ServiceInfo service = getMockedServiceModel(getClass().getResource(wsdlUrl));
-        assertNotNull(service);
-        BindingInfo binding = service.getEndpoint(new QName(service.getName().getNamespaceURI(), port))
-                        .getBinding();
-        assertNotNull(binding);
-        return binding;
-    }
-
-    protected ServiceInfo getMockedServiceModel(URL wsdlUrl) throws Exception {
-
-        WSDLManagerImpl wmi = new WSDLManagerImpl();
-        Definition def = wmi.getDefinition(wsdlUrl);        
-        
-        control = EasyMock.createNiceControl();
-        bus = control.createMock(Bus.class);
-        
-        BindingFactoryManager bindingFactoryManager = control.createMock(BindingFactoryManager.class);
-        WSDLServiceBuilder wsdlServiceBuilder = new WSDLServiceBuilder(bus);        
-        
-        Service service = null;
-        for (Iterator<?> it = def.getServices().values().iterator(); it.hasNext();) {
-            Object obj = it.next();
-            if (obj instanceof Service) {
-                service = (Service) obj;
-                break;
-            }
-        }
-
-        EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bindingFactoryManager);
-        control.replay();        
-        serviceInfo = wsdlServiceBuilder.buildService(def, service);
-        serviceInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null);
-        serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SERVICE, null);
-        return serviceInfo;
-    }
-
     protected JAXBDataReaderFactory getTestReaderFactory(Class<?> clz) throws Exception {
         JAXBContext ctx = JAXBEncoderDecoder.createJAXBContextForClass(clz);
         JAXBDataReaderFactory readerFacotry = new JAXBDataReaderFactory();
@@ -173,20 +127,39 @@
     }
     
     protected void common(String wsdl, QName portName, Class seiClazz) throws Exception {
+        control = EasyMock.createNiceControl();
+        
+        bus = control.createMock(Bus.class);
+        EasyMock.expect(bus.getExtension(WSDLManager.class)).andStubReturn(new WSDLManagerImpl());
         
-        URL wsdlUrl = this.getClass().getResource(wsdl);
-        ServiceInfo si = getMockedServiceModel(wsdlUrl);
+        BindingFactoryManager bindingFactoryManager = control.createMock(BindingFactoryManager.class);
+        EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andStubReturn(bindingFactoryManager);
+        DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
+        EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
+        
+        control.replay();        
+        
+        assertNotNull(bus.getExtension(WSDLManager.class));
+        
+        WSDLServiceFactory factory = 
+            new WSDLServiceFactory(bus, getClass().getResource(wsdl),
+                                   new QName(portName.getNamespaceURI(), "XMLService"));
+
+        org.apache.cxf.service.Service service = factory.create();
 
-        EndpointInfo epi = si.getEndpoint(portName);
+        serviceInfo = service.getServiceInfo();
+        
+        EndpointInfo epi = service.getServiceInfo().getEndpoint(portName);
+        assertNotNull(epi);
         Binding xmlBinding = new XMLBindingFactory().createBinding(epi.getBinding());
 
         control.reset();
-        org.apache.cxf.service.Service service = control.createMock(ServiceImpl.class);
-        EasyMock.expect(service.getDataBinding()).andStubReturn(new JAXBDataBinding(seiClazz));
+        service.setDataBinding(new JAXBDataBinding(seiClazz));
 
         Endpoint endpoint = control.createMock(EndpointImpl.class);
-        EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);
-        EasyMock.expect(endpoint.getBinding()).andReturn(xmlBinding);
+        EasyMock.expect(endpoint.getEndpointInfo()).andStubReturn(epi);
+        EasyMock.expect(endpoint.getBinding()).andStubReturn(xmlBinding);
+        EasyMock.expect(endpoint.getService()).andStubReturn(service);
 
         control.replay();
 

Modified: incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageInInterceptorTest.java Thu Oct  5 13:19:52 2006
@@ -25,6 +25,8 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.cxf.interceptor.WrappedInInterceptor;
+import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.hello_world_xml_http.bare.types.MyComplexStructType;
 import org.apache.hello_world_xml_http.wrapped.types.GreetMe;
@@ -74,6 +76,10 @@
         prepareMessage("/message-wrap.xml");
         common("/wsdl/hello_world_xml_wrapped.wsdl", new QName(ns, "XMLPort"),
                         org.apache.hello_world_xml_http.wrapped.Greeter.class);
+        
+        OperationInfo op = serviceInfo.getInterface().getOperation(new QName(ns, "greetMe"));
+        op.getUnwrappedOperation().getInput().setProperty(WrappedInInterceptor.WRAPPER_CLASS, GreetMe.class);
+        
         in.handleMessage(xmlMessage);
         List list = xmlMessage.getContent(List.class);
         assertNotNull(list);

Modified: incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java Thu Oct  5 13:19:52 2006
@@ -56,7 +56,9 @@
 
     List<Object> params = new ArrayList<Object>();
 
-    QName bareMyComplexStructQName = new QName(bareNsType, "myComplexStructType");
+    QName bareMyComplexStructTypeQName = new QName(bareNs, "in");
+
+    QName bareMyComplexStructQName = new QName(bareNsType, "myComplexStruct");
 
     QName bareRequestTypeQName = new QName(bareNsType, "requestType");
 
@@ -96,8 +98,9 @@
         DepthXMLStreamReader dxr = new DepthXMLStreamReader(reader);
         StaxUtils.nextEvent(dxr);
         StaxUtils.toNextElement(dxr);
-        assertEquals(bareMyComplexStructQName.getNamespaceURI(), dxr.getNamespaceURI());
-        assertEquals(bareMyComplexStructQName.getLocalPart(), dxr.getLocalName());
+        
+        assertEquals(bareMyComplexStructTypeQName.getNamespaceURI(), dxr.getNamespaceURI());
+        assertEquals(bareMyComplexStructTypeQName.getLocalPart(), dxr.getLocalName());
         StaxUtils.toNextElement(dxr);
         StaxUtils.toNextText(dxr);
         assertEquals(myComplexStruct.getElem1(), dxr.getText());
@@ -125,10 +128,12 @@
         DepthXMLStreamReader dxr = new DepthXMLStreamReader(reader);
         StaxUtils.nextEvent(dxr);
         StaxUtils.toNextElement(dxr);
+
         assertEquals(bareNs, dxr.getNamespaceURI());
         assertEquals("multiParamRootReq", dxr.getLocalName());
         StaxUtils.nextEvent(dxr);
         StaxUtils.toNextElement(dxr);
+        
         assertEquals(bareMyComplexStructQName.getNamespaceURI(), dxr.getNamespaceURI());
         assertEquals("myComplexStruct", dxr.getLocalName());
         boolean foundRequest = false;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Thu Oct  5 13:19:52 2006
@@ -31,6 +31,7 @@
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.InterceptorChain;
 import org.apache.cxf.interceptor.MessageSenderInterceptor;
@@ -250,11 +251,9 @@
                     .getConduitInitiator(transportID);
                 initedConduit = ci.getConduit(ei);
             } catch (BusException ex) {
-                // TODO: wrap in runtime exception
-                ex.printStackTrace();
+                throw new Fault(ex);
             } catch (IOException ex) {
-                // TODO: wrap in runtime exception
-                ex.printStackTrace();
+                throw new Fault(ex);
             }
         }
         return initedConduit;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java Thu Oct  5 13:19:52 2006
@@ -19,14 +19,11 @@
 
 package org.apache.cxf.interceptor;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.List;
 import java.util.ResourceBundle;
 
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 
 import org.w3c.dom.Node;
@@ -34,15 +31,21 @@
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataReaderFactory;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
 
 public abstract class AbstractInDatabindingInterceptor extends AbstractPhaseInterceptor<Message> {
+
+    private static final QName XSD_ANY = new QName("http://www.w3.org/2001/XMLSchema", "anyType", "xsd");
+
     private static final ResourceBundle BUNDLE = BundleUtils
         .getBundle(AbstractInDatabindingInterceptor.class);
 
@@ -62,10 +65,10 @@
             }
         }
         if (dataReader == null) {
-            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", BUNDLE, 
-                service.getName()));
+            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", 
+                                                                   BUNDLE, service.getName()));
         }
-        return dataReader;        
+        return dataReader;
     }
 
     protected DataReader<Message> getMessageDataReader(Message message) {
@@ -80,8 +83,8 @@
             }
         }
         if (dataReader == null) {
-            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", BUNDLE, 
-                service.getName()));
+            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", 
+                                                                   BUNDLE, service.getName()));
         }
         return dataReader;
     }
@@ -98,12 +101,12 @@
             }
         }
         if (dataReader == null) {
-            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", BUNDLE, 
-                service.getName()));
+            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", 
+                                                                   BUNDLE, service.getName()));
         }
         return dataReader;
     }
-    
+
     protected DataReader<Node> getNodeDataReader(Message message) {
         Service service = ServiceModelUtil.getService(message.getExchange());
         DataReaderFactory factory = service.getDataBinding().getDataReaderFactory();
@@ -116,8 +119,9 @@
             }
         }
         if (dataReader == null) {
-            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAREADER", BUNDLE, 
-                service.getName()));
+            throw new Fault(
+                            new org.apache.cxf.common.i18n.Message("NO_DATAREADER", BUNDLE, 
+                                                                   service.getName()));
         }
         return dataReader;
     }
@@ -127,102 +131,71 @@
         return new DepthXMLStreamReader(xr);
     }
 
-    protected OperationInfo findOperation(Collection<OperationInfo> operations, 
-                                          List<Object> parameters, boolean isRequestor) {
-        // first check for exact matches
-        for (OperationInfo o : operations) {
-            List messageParts = null;
-            if (isRequestor) {
-                if (o.hasOutput()) {
-                    messageParts = o.getOutput().getMessageParts();
-                } else {
-                    messageParts = new ArrayList();
-                }
+    /**
+     * Find the next possible message part in the message. If an operation in
+     * the list of operations is no longer a viable match, it will be removed
+     * from the Collection.
+     * 
+     * @param exchange
+     * @param operations
+     * @param name
+     * @param client
+     * @param index
+     * @return
+     */
+    protected MessagePartInfo findMessagePart(Exchange exchange, Collection<OperationInfo> operations,
+                                              QName name, boolean client, int index) {
+        MessagePartInfo lastChoice = null;
+        for (Iterator<OperationInfo> itr = operations.iterator(); itr.hasNext();) {
+            OperationInfo op = itr.next();
+
+            MessageInfo msgInfo = null;
+            if (client) {
+                msgInfo = op.getOutput();
             } else {
-                if (o.hasInput()) {
-                    messageParts = o.getInput().getMessageParts();
-                } else {
-                    messageParts = new ArrayList();
-                }
-            }
-            if (messageParts.size() == parameters.size() 
-                    && checkExactParameters(messageParts, parameters)) {
-                return o;
-                
+                msgInfo = op.getInput();
             }
-        }
 
-//        // now check for assignable matches
-        /*for (OperationInfo o : operations) {
-            List messageParts = o.getInput().getMessageParts();
-            if (messageParts.size() == parameters.size()) {
-                if (checkParameters(messageParts, parameters)) {
-                    return o;
-                }
-            }
-        }*/
-        return null;
-    }
-
-      /**
-       * Return true only if the message parts exactly match the classes of the
-       * parameters
-       * 
-       * @param messageParts
-       * @param parameters
-       * @return
-       */
-    private boolean checkExactParameters(List messageParts, List parameters) {
-        Iterator messagePartIterator = messageParts.iterator();
-        for (Iterator parameterIterator = parameters.iterator(); parameterIterator.hasNext();) {
-            Object param = parameterIterator.next();
-            JAXBElement paramEl = null;
-            MessagePartInfo mpi = (MessagePartInfo)messagePartIterator.next();
-            if (param instanceof JAXBElement) {
-                paramEl = (JAXBElement)param;
-                if (!mpi.getElementQName().equals(paramEl.getName())) {
-                    return false;
-                }
-            } else {
-                
-                if (!mpi.getElementQName().getLocalPart().equals(
-                    param.getClass().getAnnotation(XmlRootElement.class).name())) {
-               
-                    return false;
-                }
+            if (msgInfo == null) {
+                itr.remove();
+                continue;
             }
-        }
-        return true;
-    }
+            
+            Collection bodyParts = msgInfo.getMessageParts();
+            if (bodyParts.size() == 0 || bodyParts.size() <= index) {
+                itr.remove();
+                continue;
+            }
+
+            MessagePartInfo p = (MessagePartInfo)msgInfo.getMessageParts().get(index);
 
-    /*private boolean checkParameters(List messageParts, List parameters) {
-        Iterator messagePartIterator = messageParts.iterator();
-        for (Iterator parameterIterator = parameters.iterator(); parameterIterator.hasNext();) {
-            Object param = parameterIterator.next();
-            MessagePartInfo mpi = (MessagePartInfo)messagePartIterator.next();
+            if (name.equals(p.getConcreteName())) {
+                return p;
+            }
 
-            if (!mpi.getTypeClass().isAssignableFrom(param.getClass())) {
-                if (!param.getClass().isPrimitive() && mpi.getTypeClass().isPrimitive()) {
-                    return checkPrimitiveMatch(mpi.getTypeClass(), param.getClass());
-                } else {
-                    return false;
-                }
+            if (XSD_ANY.equals(p.getTypeQName())) {
+                lastChoice = p;
+            } else {
+                itr.remove();
             }
         }
-        return true;
+        return lastChoice;
     }
 
-    private boolean checkPrimitiveMatch(Class clazz, Class typeClass) {
-        if ((typeClass == Integer.class && clazz == int.class)
-            || (typeClass == Double.class && clazz == double.class)
-            || (typeClass == Long.class && clazz == long.class)
-            || (typeClass == Float.class && clazz == float.class)
-            || (typeClass == Short.class && clazz == short.class)
-            || (typeClass == Boolean.class && clazz == boolean.class)
-            || (typeClass == Byte.class && clazz == byte.class)) {
-            return true;
+    protected MessageInfo getMessageInfo(Message message, BindingOperationInfo operation, Exchange ex) {
+        return getMessageInfo(message, operation, isRequestor(message));
+    }
+    
+    protected MessageInfo getMessageInfo(Message message, BindingOperationInfo operation, boolean requestor) {
+        MessageInfo msgInfo;
+        OperationInfo intfOp = operation.getOperationInfo();
+        if (requestor) {
+            msgInfo = intfOp.getOutput();
+            message.put(MessageInfo.class, intfOp.getOutput());
+        } else {
+            msgInfo = intfOp.getInput();
+            message.put(MessageInfo.class, intfOp.getInput());
         }
-
-        return false;
-    }*/
+        return msgInfo;
+    }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java Thu Oct  5 13:19:52 2006
@@ -20,17 +20,19 @@
 package org.apache.cxf.interceptor;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ResourceBundle;
 import java.util.Set;
 
-import javax.xml.bind.JAXBElement;
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
+import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
@@ -38,6 +40,7 @@
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
@@ -45,11 +48,13 @@
 
 public class BareInInterceptor extends AbstractInDatabindingInterceptor {
 
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(BareInInterceptor.class);
+
     private static Set<String> filter = new HashSet<String>();
     
     static {
         filter.add("void");
-        filter.add("javax.activation.DataHandler");        
+        filter.add("javax.activation.DataHandler");
     }
     
     public BareInInterceptor() {
@@ -61,86 +66,70 @@
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
         Exchange exchange = message.getExchange();
 
-        BindingOperationInfo operation = exchange.get(BindingOperationInfo.class);
-
         DataReader<Message> dr = getMessageDataReader(message);
         List<Object> parameters = new ArrayList<Object>();
 
-        List<MessagePartInfo> piList = null;
-        if (operation != null) {
-            if (isRequestor(message)) {
-                piList = operation.getOperationInfo().getOutput().getMessageParts();
-            } else {
-                piList = operation.getOperationInfo().getInput().getMessageParts();
-            }
+        Endpoint ep = exchange.get(Endpoint.class);
+        Service service = ep.getService();
+        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+        MessageInfo msgInfo = message.get(MessageInfo.class);
+        
+        Collection<OperationInfo> ops = null;
+        if (bop == null) {
+            ops = new ArrayList<OperationInfo>();
+            ops.addAll(service.getServiceInfo().getInterface().getOperations());
+        } else if (msgInfo == null) {
+            msgInfo = getMessageInfo(message, bop, exchange);
         }
+        
+        boolean client = isRequestor(message);
+        
+        int paramNum = 0;
         while (StaxUtils.toNextElement(xmlReader)) {
-            QName streamParaQName = new QName(xmlReader.getNamespaceURI(), xmlReader.getLocalName());
+            QName elName = xmlReader.getName();
             Object o = null;
-            if (piList != null) {                
-                for (MessagePartInfo mpi : piList) {
-                    QName paraQName = null;
-                    if (mpi.isElement()) {
-                        paraQName = mpi.getElementQName();
-                    } else {
-                        paraQName = mpi.getTypeQName();
-                    }
-                    if (streamParaQName.equals(paraQName)) {
-                        Class cls = (Class)mpi.getProperty(Class.class.getName());
-                        if (cls != null && !filter.contains(cls.getName()) && !cls.isArray()) {
-                            o = dr.read(paraQName, message, cls);
-                        } else {
-                            o = dr.read(paraQName, message, null);
-                        }
-                        break;
-                    }
-                }
-                if (o == null) {
-                    o = dr.read(message);                    
-                }
+            
+            MessagePartInfo p;
+            if (msgInfo != null) {
+                p = msgInfo.getMessagePartByIndex(paramNum);
+            } else {
+                p = findMessagePart(exchange, ops, elName, client, paramNum);
+            }
+            
+            if (p == null) {
+                throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", BUNDLE, elName));
+            }
+            
+            Class<?> cls = (Class) p.getProperty(Class.class.getName());
+            if (cls != null && !filter.contains(cls.getName()) && !cls.isArray()) {
+                o = dr.read(p.getConcreteName(), message, cls);
             } else {
-                o = dr.read(message);
+                o = dr.read(p.getConcreteName(), message, null);
             }
+            
             if (o != null) {
                 parameters.add(o);
             }
+            paramNum++;
         }
-        
-        Endpoint ep = exchange.get(Endpoint.class);
-        Service service = ep.getService();
 
         if (message.get(Element.class) != null) {
             parameters.addAll(abstractParamsFromHeader(message.get(Element.class), ep, message));
         }
 
-        if (operation == null) {            
-            // If we didn't know the operation going into this, lets try to
-            // figure it out
-            OperationInfo op = findOperation(service.getServiceInfo().getInterface().getOperations(),
-                            parameters, isRequestor(message));
-            for (BindingOperationInfo bop : ep.getEndpointInfo().getBinding().getOperations()) {
-                if (bop.getOperationInfo().equals(op)) {
-                    operation = bop;
-                    exchange.put(BindingOperationInfo.class, bop);
-                    exchange.setOneWay(bop.getOutput() == null);
-                    break;
-                }
+        // if we didn't know the operation going into this, find it.
+        if (bop == null) {
+            OperationInfo op = ops.iterator().next();
+            bop = ep.getEndpointInfo().getBinding().getOperation(op);
+            if (bop != null) {
+                exchange.put(BindingOperationInfo.class, bop);
+                exchange.setOneWay(op.isOneWay());
             }
         }
-
-        List<Object> newParameters = new ArrayList<Object>();
-        for (Iterator iter = parameters.iterator(); iter.hasNext();) {
-            Object element = (Object) iter.next();
-            if (element instanceof JAXBElement) {
-                element = ((JAXBElement) element).getValue();
-            }
-            newParameters.add(element);
-
-        }
-
-        message.setContent(List.class, newParameters);
+        
+        message.setContent(List.class, parameters);
     }
-
+    
     private List<Object> abstractParamsFromHeader(Element headerElement, Endpoint ep, Message message) {
         List<Object> paramInHeader = new ArrayList<Object>();
         List<MessagePartInfo> parts = null;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java Thu Oct  5 13:19:52 2006
@@ -20,15 +20,12 @@
 package org.apache.cxf.interceptor;
 import java.util.List;
 
-import javax.xml.namespace.QName;
-
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceModelUtil;
 
 public class BareOutInterceptor extends AbstractOutDatabindingInterceptor {
 
@@ -76,8 +73,8 @@
                         //this part should be in header, should donot write to soap body
                         continue;
                     }
-                    QName elName = ServiceModelUtil.getPartName(part);
-                    dataWriter.write(arg, elName, message);
+                    
+                    dataWriter.write(arg, part.getConcreteName(), message);
                 }
             }
         }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/Messages.properties Thu Oct  5 13:19:52 2006
@@ -6,4 +6,5 @@
 NO_DATAREADER=No DataReader is available for Service: {0}
 NO_DATAWRITER=No DataWriter is available for Service: {0}
 COULD_NOT_UNRWAP=Could not unrwap message parts.
-COULD_NOT_SEND=Could not send Message.
\ No newline at end of file
+COULD_NOT_SEND=Could not send Message.
+NO_PART_FOUND=Message part {0} was not recognized.
\ No newline at end of file

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java Thu Oct  5 13:19:52 2006
@@ -20,20 +20,19 @@
 package org.apache.cxf.interceptor;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 
-import javax.xml.bind.JAXBElement;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamConstants;
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
-import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
@@ -42,7 +41,7 @@
 public class WrappedInInterceptor extends AbstractInDatabindingInterceptor {
     public static final String WRAPPER_CLASS = "wrapper.class";
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WrappedInInterceptor.class);
-    
+
     public WrappedInInterceptor() {
         super();
         setPhase(Phase.UNMARSHAL);
@@ -56,61 +55,73 @@
             // body may be empty for partial response to decoupled request
             return;
         }
+
         BindingOperationInfo operation = message.getExchange().get(BindingOperationInfo.class);
         boolean requestor = isRequestor(message);
-        
-        MessageInfo msgInfo;
+
         if (operation == null) {
-            String opName = xmlReader.getLocalName();
-            if (requestor && opName.endsWith("Response")) {
-                opName = opName.substring(0, opName.length() - 8);
+            String local = xmlReader.getLocalName();
+            if (requestor && local.endsWith("Response")) {
+                local = local.substring(0, local.length() - 8);
             }
-    
+
             // TODO: Allow overridden methods.
-            operation = ServiceModelUtil.getOperation(message.getExchange(), opName);
+            operation = ServiceModelUtil.getOperation(message.getExchange(), local);
             if (operation == null) {
-                throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION", BUNDLE, opName));
+                throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION", BUNDLE, local));
             }
-            message.getExchange().put(BindingOperationInfo.class, operation);
-            message.getExchange().put(OperationInfo.class, operation.getOperationInfo());
-            message.getExchange().setOneWay(operation.getOutput() == null);
-        }
-        if (requestor) {
-            msgInfo = operation.getOperationInfo().getOutput();
-            message.put(BindingMessageInfo.class, operation.getOutput());            
-        } else {
-            msgInfo = operation.getOperationInfo().getInput();
-            message.put(BindingMessageInfo.class, operation.getInput());
+
         }
-        message.put(MessageInfo.class, msgInfo);
-        
+
         DataReader<Message> dr = getMessageDataReader(message);
         List<Object> objects;
-        
+
         // Determine if there is a wrapper class
-        if (operation.isUnwrapped() || operation.isUnwrappedCapable()) {
+        if ((operation.isUnwrapped() || operation.isUnwrappedCapable())
+            && operation.getOperationInfo().getUnwrappedOperation().getInput()
+                .getProperty(WRAPPER_CLASS) != null) {
             objects = new ArrayList<Object>();
             Object wrappedObject = dr.read(message);
-            if (wrappedObject instanceof JAXBElement) {
-                wrappedObject = ((JAXBElement) wrappedObject).getValue();
-            }
             objects.add(wrappedObject);
+
+            setMessage(message, operation, requestor);
         } else {
             // Unwrap each part individually if we don't have a wrapper
             objects = new ArrayList<Object>();
-            int depth = xmlReader.getDepth();
-            
-            try {
-                while (xmlReader.nextTag() == XMLStreamReader.START_ELEMENT && xmlReader.getDepth() > depth) {
-                    objects.add(dr.read(message));
-                }
-            } catch (XMLStreamException e) {
-                throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_READ_EXC", BUNDLE), e);
+
+            if (operation.isUnwrappedCapable()) {
+                operation = operation.getUnwrappedOperation();
+            }
+
+            MessageInfo msgInfo = setMessage(message, operation, requestor);
+            List<MessagePartInfo> messageParts = msgInfo.getMessageParts();
+            Iterator<MessagePartInfo> itr = messageParts.iterator();
+
+            // advance just past the wrapped element so we don't get stuck
+            if (xmlReader.getEventType() == XMLStreamConstants.START_ELEMENT) {
+                StaxUtils.nextEvent(xmlReader);
             }
+
+            // loop through each child element
+            while (StaxUtils.toNextElement(xmlReader)) {
+                MessagePartInfo part = itr.next();
+                Class c = (Class)part.getProperty(Class.class.getName());
+                objects.add(dr.read(part.getConcreteName(), message, c));
+            }
+
         }
-        
+
         message.setContent(List.class, objects);
     }
 
-}
+    private MessageInfo setMessage(Message message, BindingOperationInfo operation, boolean requestor) {
+        MessageInfo msgInfo = getMessageInfo(message, operation, requestor);
+        message.put(MessageInfo.class, msgInfo);
 
+        message.getExchange().put(BindingOperationInfo.class, operation);
+        message.getExchange().put(OperationInfo.class, operation.getOperationInfo());
+        message.getExchange().setOneWay(operation.getOperationInfo().isOneWay());
+
+        return msgInfo;
+    }
+}

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java Thu Oct  5 13:19:52 2006
@@ -27,12 +27,12 @@
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 
-public class WrappedOutInterceptor extends AbstractPhaseInterceptor<Message> {
+public class WrappedOutInterceptor extends AbstractOutDatabindingInterceptor {
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WrappedOutInterceptor.class);
 
     public WrappedOutInterceptor() {
@@ -47,11 +47,20 @@
         if (bop != null && bop.isUnwrapped()) {
             XMLStreamWriter xmlWriter = getXMLStreamWriter(message);
 
-            MessageInfo messageInfo = message.get(MessageInfo.class);
-            QName name = messageInfo.getName();
+            MessageInfo messageInfo;
+            if (isRequestor(message)) {
+                messageInfo = bop.getWrappedOperation().getOperationInfo().getInput();
+            } else {
+                messageInfo = bop.getWrappedOperation().getOperationInfo().getOutput();
+            }
+            
+            MessagePartInfo part = messageInfo.getMessageParts().get(0);
+            QName name = part.getConcreteName();
 
             try {
-                xmlWriter.writeStartElement(name.getLocalPart(), name.getNamespaceURI());
+                xmlWriter.setDefaultNamespace(name.getNamespaceURI());
+                xmlWriter.writeStartElement(name.getNamespaceURI(), name.getLocalPart());
+                xmlWriter.writeDefaultNamespace(name.getNamespaceURI());
                 message.getInterceptorChain().doIntercept(message);
                 xmlWriter.writeEndElement();
             } catch (XMLStreamException e) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceImpl.java Thu Oct  5 13:19:52 2006
@@ -19,12 +19,15 @@
 
 package org.apache.cxf.service;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.Executor;
 
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.configuration.Configurable;
 import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.ServiceInfo;
@@ -35,6 +38,7 @@
     private DataBinding dataBinding;
     private Executor executor;
     private Invoker invoker;
+    private Map<QName, Endpoint> endpoints = new HashMap<QName, Endpoint>();
     
     public ServiceImpl(ServiceInfo si) {
         serviceInfo = si;
@@ -74,6 +78,14 @@
 
     public void setDataBinding(DataBinding dataBinding) {
         this.dataBinding = dataBinding;
+    }
+
+    public Map<QName, Endpoint> getEndpoints() {
+        return endpoints;
+    }
+
+    public void setEndpoints(Map<QName, Endpoint> endpoints) {
+        this.endpoints = endpoints;
     }
     
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/ServiceModelVisitor.java Thu Oct  5 13:19:52 2006
@@ -24,6 +24,7 @@
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.service.model.UnwrappedOperationInfo;
 
 /**
  * Implements the Visitor pattern for the Service model.
@@ -44,44 +45,56 @@
         for (OperationInfo o : serviceInfo.getInterface().getOperations()) {
             begin(o);
             
-            MessageInfo in = o.getInput();
-            if (in != null) {
-                begin(in);
-                
-                for (MessagePartInfo part : in.getMessageParts()) {
-                    begin(part);
-                    end(part);
-                }
-                
-                end(in);
+            visitOperation(o);
+            
+            end(o);
+        }
+        
+        end(serviceInfo);
+    }
+
+    private void visitOperation(OperationInfo o) {
+        MessageInfo in = o.getInput();
+        if (in != null) {
+            begin(in);
+            
+            for (MessagePartInfo part : in.getMessageParts()) {
+                begin(part);
+                end(part);
             }
             
-            MessageInfo out = o.getOutput();
-            if (out != null) {
-                begin(out);
-                
-                for (MessagePartInfo part : out.getMessageParts()) {
-                    begin(part);
-                    end(part);
-                }
-                
-                end(out);
+            end(in);
+        }
+        
+        MessageInfo out = o.getOutput();
+        if (out != null) {
+            begin(out);
+            
+            for (MessagePartInfo part : out.getMessageParts()) {
+                begin(part);
+                end(part);
             }
             
-            for (FaultInfo f : o.getFaults()) {
-                begin(f);
-                
-                for (MessagePartInfo part : f.getMessageParts()) {
-                    begin(part);
-                    end(part);
-                }
-                
-                end(f);
+            end(out);
+        }
+        
+        for (FaultInfo f : o.getFaults()) {
+            begin(f);
+            
+            for (MessagePartInfo part : f.getMessageParts()) {
+                begin(part);
+                end(part);
             }
-            end(o);
+            
+            end(f);
         }
         
-        end(serviceInfo);
+        if (o.isUnwrappedCapable()) {
+            OperationInfo uop = o.getUnwrappedOperation();
+            begin(uop);
+            visitOperation(o.getUnwrappedOperation());
+            end(uop);
+        }
     }
     
     public void begin(ServiceInfo service) {
@@ -90,6 +103,8 @@
     }
     public void begin(OperationInfo op) {
     }
+    public void begin(UnwrappedOperationInfo op) {
+    }
     public void begin(MessageInfo msg) {
     }
     public void begin(MessagePartInfo part) {
@@ -101,6 +116,8 @@
     public void end(InterfaceInfo intf) {
     }
     public void end(OperationInfo op) {
+    }
+    public void end(UnwrappedOperationInfo op) {
     }
     public void end(MessageInfo msg) {
     }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java?view=diff&rev=453355&r1=453354&r2=453355
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java Thu Oct  5 13:19:52 2006
@@ -43,6 +43,8 @@
     }
     
     protected void initializeDataBindings() {
+        dataBinding.initialize(getService().getServiceInfo());
+        
         service.setDataBinding(dataBinding);
     }
     



Mime
View raw message