cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r449480 [1/2] - 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/test/java/org/apache/cxf/service/model/ common/common/src/mai...
Date Sun, 24 Sep 2006 20:55:25 GMT
Author: dandiep
Date: Sun Sep 24 13:55:22 2006
New Revision: 449480

URL: http://svn.apache.org/viewvc?view=rev&rev=449480
Log:
o Centralize BindingOp/Operation/Method association logic into a MethodDispatcher.
  Whenever we need to find the method for an operation or vis a versa, we can 
  look it up from the MethodDispatcher now. I'd like to extend this into a more
  general dispatching system like Spring web services has, but small steps...
o Work on getting the code first approach working. Started by constructing a simple
  service with the ReflectionServiceFactoryBean. It still needs to set up the message
  parts and bindings.
o Add a ProviderServiceFactoryBean to create a Provider from a class. Still needs
  SOAP binding support. 
o Attempted to unify the JaxWsServiceFactoryBean and the JaxWsImplementorInfo better
o Fix the namespace of the XML binding to use apache.org instead of celtix.org
o Add failing HolderTest which demonstrates thate Holders with byte[] arrays don't 
  seem to work.
o Add a HeaderTest to JAX-WS as it was impossible to track down a server side 
  header bug with the multithreaded systests.
o Have URIResolver take an optional calling class argument so it can work its 
  classloader magic.

Added:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsMethodDispatcher.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/echoData.xml   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBeanTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/SourcePayloadProvider.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/testHeader5.xml   (with props)
Removed:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsUtils.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/BindingOperationInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/InterfaceInfoTest.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLConstants.java
    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/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.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/AbstractOutDatabindingInterceptor.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/FaultChainIntiatorInterceptor.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/factory/AbstractServiceConfiguration.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/service/factory/DefaultServiceConfiguration.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.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/JAXBEncoderDecoder.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/EndpointInvocationHandler.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.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/Messages.properties
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/EndpointImplTest.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/JaxWsServiceFactoryBeanTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadXMLBindingProvider.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/HWSoapMessageProvider.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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -126,14 +126,14 @@
             try {
                 Interceptor currentInterceptor = iterator.next();
                
-                if (LOG.isLoggable(Level.FINE)) {
-                    LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor);
-                }
+                System.out.println("Invoking handleMessage on interceptor " + currentInterceptor);
                 currentInterceptor.handleMessage(message);
             } catch (Exception ex) {
                 if (LOG.isLoggable(Level.INFO)) {
                     LogUtils.log(LOG, Level.INFO, "Interceptor has thrown exception, unwinding now", ex);
                 }
+                System.out.println("STACK!");
+                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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -24,8 +24,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.databinding.DataReaderFactory;
-import org.apache.cxf.databinding.DataWriterFactory;
+import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.interceptor.InterceptorProvider;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.ServiceInfo;
@@ -36,13 +35,9 @@
     
     ServiceInfo getServiceInfo();
 
-    DataReaderFactory getDataReaderFactory();
-    
-    DataWriterFactory getDataWriterFactory();
-
-    void setDataReaderFactory(DataReaderFactory dataReaderFactory);
+    DataBinding getDataBinding();
 
-    void setDataWriterFactory(DataWriterFactory dataWriterFactory);
+    void setDataBinding(DataBinding dataBinding);
     
     Executor getExecutor();
 

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -120,6 +120,16 @@
     public Collection<BindingOperationInfo> getOperations() {
         return Collections.unmodifiableCollection(operations.values());
     }
+
+    public BindingOperationInfo getOperation(OperationInfo oi) {
+        for (BindingOperationInfo b : operations.values()) {
+            if (b.getOperationInfo() == oi || b.getUnwrappedOperation().getOperationInfo() == oi) {
+                return b;
+            }
+        }
+        
+        return null;
+    }
 }
 
 

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java Sun Sep 24 13:55:22 2006
@@ -126,5 +126,4 @@
     public BindingOperationInfo getWrappedOperation() {
         return opHolder;
     }
-
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java Sun Sep 24 13:55:22 2006
@@ -42,6 +42,7 @@
     public InterfaceInfo(ServiceInfo info, QName q) {
         name = q;
         service = info;
+        info.setInterface(this);
     }
     
     public ServiceInfo getService() {

Modified: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/InterfaceInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/InterfaceInfoTest.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/InterfaceInfoTest.java (original)
+++ incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/InterfaceInfoTest.java Sun Sep 24 13:55:22 2006
@@ -28,7 +28,7 @@
     private InterfaceInfo interfaceInfo;
 
     public void setUp() throws Exception {
-        interfaceInfo = new InterfaceInfo(null, new QName(
+        interfaceInfo = new InterfaceInfo(new ServiceInfo(), new QName(
             "http://apache.org/hello_world_soap_http", "interfaceTest"));
     }
     

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java Sun Sep 24 13:55:22 2006
@@ -61,6 +61,10 @@
             }
         }
 
+        if (url == null) {
+            url = callingClass.getResource(resourceName);
+        }
+        
         if ((url == null) && (resourceName != null) && (resourceName.charAt(0) != '/')) {
             return getResource('/' + resourceName, callingClass);
         }

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java Sun Sep 24 13:55:22 2006
@@ -55,6 +55,10 @@
     }
 
     public URIResolver(String baseUriStr, String uriStr) throws IOException {
+        this(baseUriStr, uriStr, null);
+    }
+
+    public URIResolver(String baseUriStr, String uriStr, Class callingClass) throws IOException {
         try {
             URI relative;
             File uriFile = new File(uriStr);
@@ -99,8 +103,12 @@
                 throw new RuntimeException("File was deleted! " + uriStr, e);
             }
         } else if (is == null) {
-            URL url = ClassLoaderUtils.getResource(uriStr, getClass());
-
+            if (callingClass == null) {
+                callingClass = getClass();
+            }
+            
+            URL url = ClassLoaderUtils.getResource(uriStr, callingClass);
+            
             if (url == null) {
                 try {
                     url = new URL(uriStr);
@@ -112,13 +120,13 @@
                     // Do nothing
                 }
             } else {
+                try {
+                    uri = new URI(url.toString());
+                } catch (URISyntaxException e) {
+                    // do nothing?
+                }
                 is = url.openStream();
             }
-        }
-
-        if (is == null) {
-            throw new IOException("Could not find resource '" + uriStr
-                                  + "' relative to '" + baseUriStr + "'");
         }
     }
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Sun Sep 24 13:55:22 2006
@@ -152,7 +152,7 @@
             sb.getOutInterceptors().add(new WrappedOutInterceptor());
             sb.getOutInterceptors().add(new BareOutInterceptor());
         }
-
+        
         return sb;
     }
 
@@ -270,5 +270,5 @@
         }
 
         bmsg.addExtensor(bodyInfo);
-    }
+    }    
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AttachmentOutInterceptor.java Sun Sep 24 13:55:22 2006
@@ -44,6 +44,8 @@
     }
 
     public void handleMessage(SoapMessage message) throws Fault {
+        // TODO: We shouldn't be running this interceptor if MTOM isn't enabled
+        // as caching everything is going to slow us down
         
         OutputStream os = message.getContent(OutputStream.class);
         CachedStream cs = new CachedStream();

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java Sun Sep 24 13:55:22 2006
@@ -135,8 +135,7 @@
             
             Object[] args = objs.toArray();
             Object[] els = parts.toArray();
- 
-             
+            
             SoapVersion soapVersion = message.getVersion();
             for (int idx = 0; idx < countParts; idx++) {
                 Object arg = args[idx];
@@ -181,7 +180,7 @@
 
     protected DataWriter<XMLStreamWriter> getDataWriter(Message message) {
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataWriterFactory factory = service.getDataWriterFactory();
+        DataWriterFactory factory = service.getDataBinding().getDataWriterFactory();
 
         DataWriter<XMLStreamWriter> dataWriter = null;
         for (Class<?> cls : factory.getSupportedFormats()) {

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLConstants.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLConstants.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLConstants.java Sun Sep 24 13:55:22 2006
@@ -21,6 +21,6 @@
 
 
 public final class XMLConstants {
-    public static final String NS_XML_FORMAT = "http://celtix.objectweb.org/bindings/xformat";
+    public static final String NS_XML_FORMAT = "http://cxf.apache.org/bindings/xformat";
 
 }

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -88,8 +88,6 @@
                     } else {
                         // processing wrap here
                         message.getExchange().put(BindingOperationInfo.class, boi);
-                        boi.getOperationInfo().setProperty(WrappedInInterceptor.SINGLE_WRAPPED_PART,
-                                        Boolean.TRUE);
                         new WrappedInInterceptor().handleMessage(message);
                         break;
                     }

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -42,6 +42,7 @@
 import org.apache.cxf.binding.xml.XMLBindingFactory;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.jaxb.JAXBDataReaderFactory;
 import org.apache.cxf.jaxb.JAXBDataWriterFactory;
 import org.apache.cxf.jaxb.JAXBEncoderDecoder;
@@ -181,8 +182,7 @@
 
         control.reset();
         org.apache.cxf.service.Service service = control.createMock(ServiceImpl.class);
-        EasyMock.expect(service.getDataReaderFactory()).andReturn(getTestReaderFactory(seiClazz));
-        EasyMock.expect(service.getDataWriterFactory()).andReturn(getTestWriterFactory(seiClazz));
+        EasyMock.expect(service.getDataBinding()).andStubReturn(new JAXBDataBinding(seiClazz));
 
         Endpoint endpoint = control.createMock(EndpointImpl.class);
         EasyMock.expect(endpoint.getEndpointInfo()).andReturn(epi);

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -20,7 +20,6 @@
 package org.apache.cxf.endpoint;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
@@ -60,8 +59,8 @@
     
     Bus bus;
     Endpoint endpoint;
-    Method methd;
     Conduit initedConduit;
+    
     public ClientImpl(Bus b, Endpoint e) {
         bus = b;
         endpoint = e;
@@ -195,21 +194,10 @@
             message.setContent(List.class, Arrays.asList(params));
         }
     }
-
-//    private void setMethod(Map<String, Object> ctx, Message message) {
-//        if (ctx != null) {
-//            message.setContent(Method.class, ctx.get(Method.class.getName()));
-//            methd = (Method)ctx.get(Method.class.getName());
-//        }
-//    }
-
     
-
     public void onMessage(Message message) {
-       
         message = endpoint.getBinding().createMessage(message);
         message.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
-        message.setContent(Method.class, methd);
         PhaseManager pm = bus.getExtension(PhaseManager.class);
         PhaseInterceptorChain chain = new PhaseInterceptorChain(pm.getInPhases());
         message.setInterceptorChain(chain);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/EndpointImpl.java Sun Sep 24 13:55:22 2006
@@ -23,6 +23,8 @@
 import java.util.concurrent.Executor;
 import java.util.logging.Logger;
 
+import javax.xml.namespace.QName;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.Binding;
@@ -49,7 +51,15 @@
     private Bus bus;
     private Interceptor faultInterceptor;
     
+    public EndpointImpl(Bus bus, Service s, QName endpointName) throws EndpointException {
+        this(bus, s, s.getServiceInfo().getEndpoint(endpointName));
+    }
+    
     public EndpointImpl(Bus bus, Service s, EndpointInfo ei) throws EndpointException {
+        if (ei == null) {
+            throw new NullPointerException("EndpointInfo can not be null!");
+        }
+        
         this.bus = bus;
         service = s;
         endpointInfo = ei;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServerImpl.java Sun Sep 24 13:55:22 2006
@@ -68,7 +68,7 @@
     }
 
     public void stop() {
-        System.out.println("server to be stopped!");
+        LOG.fine("Server is stopping.");
         getDestination().setMessageObserver(null);        
     }
 

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -31,7 +31,6 @@
 
 import org.w3c.dom.Node;
 
-
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataReaderFactory;
@@ -53,7 +52,7 @@
 
     protected DataReader getDataReader(Message message, Class<?> input) {
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataReaderFactory factory = service.getDataReaderFactory();
+        DataReaderFactory factory = service.getDataBinding().getDataReaderFactory();
 
         DataReader dataReader = null;
         for (Class<?> cls : factory.getSupportedFormats()) {
@@ -71,7 +70,7 @@
 
     protected DataReader<Message> getMessageDataReader(Message message) {
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataReaderFactory factory = service.getDataReaderFactory();
+        DataReaderFactory factory = service.getDataBinding().getDataReaderFactory();
 
         DataReader<Message> dataReader = null;
         for (Class<?> cls : factory.getSupportedFormats()) {
@@ -89,7 +88,7 @@
 
     protected DataReader<XMLStreamReader> getDataReader(Message message) {
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataReaderFactory factory = service.getDataReaderFactory();
+        DataReaderFactory factory = service.getDataBinding().getDataReaderFactory();
 
         DataReader<XMLStreamReader> dataReader = null;
         for (Class<?> cls : factory.getSupportedFormats()) {
@@ -107,7 +106,7 @@
     
     protected DataReader<Node> getNodeDataReader(Message message) {
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataReaderFactory factory = service.getDataReaderFactory();
+        DataReaderFactory factory = service.getDataBinding().getDataReaderFactory();
 
         DataReader<Node> dataReader = null;
         for (Class<?> cls : factory.getSupportedFormats()) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java Sun Sep 24 13:55:22 2006
@@ -41,7 +41,7 @@
     
     protected DataWriter getDataWriter(Message message, Class<?> output) {
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataWriterFactory factory = service.getDataWriterFactory();
+        DataWriterFactory factory = service.getDataBinding().getDataWriterFactory();
 
         DataWriter dataWriter = null;
         for (Class<?> cls : factory.getSupportedFormats()) {
@@ -62,7 +62,7 @@
     protected DataWriter<Message> getMessageDataWriter(Message message) {
         
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataWriterFactory factory = service.getDataWriterFactory();
+        DataWriterFactory factory = service.getDataBinding().getDataWriterFactory();
 
         DataWriter<Message> dataWriter = null;
         for (Class<?> cls : factory.getSupportedFormats()) {
@@ -82,7 +82,7 @@
 
     protected DataWriter<XMLStreamWriter> getDataWriter(Message message) {
         Service service = ServiceModelUtil.getService(message.getExchange());
-        DataWriterFactory factory = service.getDataWriterFactory();
+        DataWriterFactory factory = service.getDataBinding().getDataWriterFactory();
 
         DataWriter<XMLStreamWriter> dataWriter = null;
         for (Class<?> cls : factory.getSupportedFormats()) {

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -115,8 +115,7 @@
 
         if (operation == null) {            
             // If we didn't know the operation going into this, lets try to
-            // figure
-            // it out
+            // figure it out
             OperationInfo op = findOperation(service.getServiceInfo().getInterface().getOperations(),
                             parameters, isRequestor(message));
             for (BindingOperationInfo bop : ep.getEndpointInfo().getBinding().getOperations()) {

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -61,8 +61,6 @@
             List<?> objs = message.getContent(List.class);
             Object[] args = objs.toArray();
             Object[] els = parts.toArray();
-
-
                         
             for (int idx = 0; idx < countParts; idx++) {
                 Object arg = args[idx];

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FaultChainIntiatorInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FaultChainIntiatorInterceptor.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FaultChainIntiatorInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FaultChainIntiatorInterceptor.java Sun Sep 24 13:55:22 2006
@@ -22,6 +22,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.phase.PhaseManager;
 
@@ -37,7 +38,19 @@
 
     public void handleMessage(Message m) {
         Message message = m.getExchange().getFaultMessage();
-        message.setContent(Exception.class, m.getContent(Exception.class));
+        if (message == null) {
+            message = new MessageImpl();
+            m.getExchange().setFaultMessage(message);
+        }
+        
+        Exception e = m.getContent(Exception.class);
+        Fault f;
+        if (e instanceof Fault) {
+            f = (Fault) e;
+        } else {
+            f = new Fault(e);
+        }
+        message.setContent(Exception.class, f);
         
         // setup chain
         PhaseInterceptorChain chain = new PhaseInterceptorChain(bus.getExtension(PhaseManager.class)

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -1,5 +1,6 @@
 STREAM_CREATE_EXC = Could not create XMLStreamReader.
 STAX_READ_EXC = Could not read from XMLStreamReader.
+STAX_WRITE_EXC = Could not write to XMLStreamWriter.
 NO_OPERATION_ELEMENT=There must be an operation element.
 NO_OPERATION=No such operation: {0}
 NO_DATAREADER=No DataReader is available for Service: {0}

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -39,7 +39,7 @@
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class WrappedInInterceptor extends AbstractInDatabindingInterceptor {
-    public static final String SINGLE_WRAPPED_PART = "single.wrapped.in.part";
+    public static final String WRAPPER_CLASS = "wrapper.class";
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WrappedInInterceptor.class);
     
     public WrappedInInterceptor() {
@@ -57,6 +57,7 @@
         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")) {
@@ -73,18 +74,19 @@
             message.getExchange().setOneWay(operation.getOutput() == null);
         }
         if (requestor) {
-            message.put(MessageInfo.class, operation.getOperationInfo().getOutput());
+            msgInfo = operation.getOperationInfo().getOutput();
             message.put(BindingMessageInfo.class, operation.getOutput());            
         } else {
-            message.put(MessageInfo.class, operation.getOperationInfo().getInput());
+            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 (Boolean.TRUE.equals(operation.getOperationInfo().getProperty(SINGLE_WRAPPED_PART))) {
+        if (operation.isUnwrapped() || operation.isUnwrappedCapable()) {
             objects = new ArrayList<Object>();
             Object wrappedObject = dr.read(message);
             objects.add(wrappedObject);

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -43,6 +43,7 @@
 
     public void handleMessage(Message message) {
         BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
+
         if (bop != null && bop.isUnwrapped()) {
             XMLStreamWriter xmlWriter = getXMLStreamWriter(message);
 
@@ -54,7 +55,7 @@
                 message.getInterceptorChain().doIntercept(message);
                 xmlWriter.writeEndElement();
             } catch (XMLStreamException e) {
-                throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_READ_EXC", BUNDLE, e));
+                throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC", BUNDLE), 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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -23,8 +23,7 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.databinding.DataReaderFactory;
-import org.apache.cxf.databinding.DataWriterFactory;
+import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.ServiceInfo;
@@ -32,8 +31,7 @@
 public class ServiceImpl extends AbstractAttributedInterceptorProvider implements Service {
 
     private ServiceInfo serviceInfo;
-    private DataReaderFactory dataReaderFactory;
-    private DataWriterFactory dataWriterFactory;
+    private DataBinding dataBinding;
     private Executor executor;
     private Invoker invoker;
     
@@ -49,22 +47,6 @@
         return serviceInfo;
     }
 
-    public DataReaderFactory getDataReaderFactory() {
-        return dataReaderFactory;
-    }
-
-    public void setDataReaderFactory(DataReaderFactory dataReaderFactory) {
-        this.dataReaderFactory = dataReaderFactory;
-    }
-
-    public DataWriterFactory getDataWriterFactory() {
-        return dataWriterFactory;
-    }
-
-    public void setDataWriterFactory(DataWriterFactory dataWriterFactory) {
-        this.dataWriterFactory = dataWriterFactory;
-    }
-
     public Executor getExecutor() {
         return executor;
     }
@@ -80,4 +62,13 @@
     public void setInvoker(Invoker invoker) {
         this.invoker = invoker;
     }
+
+    public DataBinding getDataBinding() {
+        return dataBinding;
+    }
+
+    public void setDataBinding(DataBinding dataBinding) {
+        this.dataBinding = dataBinding;
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java Sun Sep 24 13:55:22 2006
@@ -119,7 +119,7 @@
         return null;
     }
 
-    public QName getPortType(Class clazz) {
+    public QName getInterfaceName() {
         return null;
     }
 

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=449480&r1=449479&r2=449480
==============================================================================
--- 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 Sun Sep 24 13:55:22 2006
@@ -20,8 +20,7 @@
 package org.apache.cxf.service.factory;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.databinding.DataReaderFactory;
-import org.apache.cxf.databinding.DataWriterFactory;
+import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.interceptor.MessageSenderInterceptor;
 import org.apache.cxf.interceptor.OutgoingChainInterceptor;
 import org.apache.cxf.interceptor.OutgoingChainSetupInterceptor;
@@ -30,8 +29,7 @@
 
 public abstract class AbstractServiceFactoryBean {
     private Bus bus;
-    private DataReaderFactory dataReaderFactory;
-    private DataWriterFactory dataWriterFactory;
+    private DataBinding dataBinding;
     private Service service;
     
     public abstract Service create();
@@ -45,8 +43,7 @@
     }
     
     protected void initializeDataBindings() {
-        service.setDataReaderFactory(dataReaderFactory);
-        service.setDataWriterFactory(dataWriterFactory);
+        service.setDataBinding(dataBinding);
     }
     
     public Bus getBus() {
@@ -57,20 +54,12 @@
         this.bus = bus;
     }
 
-    public DataReaderFactory getDataReaderFactory() {
-        return dataReaderFactory;
+    public DataBinding getDataBinding() {
+        return dataBinding;
     }
 
-    public void setDataReaderFactory(DataReaderFactory dataReaderFactory) {
-        this.dataReaderFactory = dataReaderFactory;
-    }
-
-    public DataWriterFactory getDataWriterFactory() {
-        return dataWriterFactory;
-    }
-
-    public void setDataWriterFactory(DataWriterFactory dataWriterFactory) {
-        this.dataWriterFactory = dataWriterFactory;
+    public void setDataBinding(DataBinding dataBinding) {
+        this.dataBinding = dataBinding;
     }
 
     public Service getService() {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java Sun Sep 24 13:55:22 2006
@@ -20,16 +20,118 @@
 package org.apache.cxf.service.factory;
 
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.helpers.ServiceUtils;
+import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.InterfaceInfo;
+import org.apache.cxf.service.model.OperationInfo;
 
 public class DefaultServiceConfiguration extends AbstractServiceConfiguration {
 
     @Override
     public QName getOperationName(InterfaceInfo service, Method method) {
         return new QName(service.getName().getNamespaceURI(), method.getName());
+    }
+
+    @Override
+    public String getAction(OperationInfo op) {
+        // TODO Auto-generated method stub
+        return super.getAction(op);
+    }
+
+    @Override
+    public QName getFaultName(Service service, OperationInfo o, Class exClass, Class beanClass) {
+        // TODO Auto-generated method stub
+        return super.getFaultName(service, o, exClass, beanClass);
+    }
+
+    @Override
+    public QName getInParameterName(OperationInfo op, Method method, int paramNumber, boolean doc) {
+        // TODO Auto-generated method stub
+        return super.getInParameterName(op, method, paramNumber, doc);
+    }
+
+    @Override
+    public QName getInputMessageName(OperationInfo op) {
+        // TODO Auto-generated method stub
+        return super.getInputMessageName(op);
+    }
+
+    @Override
+    public String getMEP(Method method) {
+        // TODO Auto-generated method stub
+        return super.getMEP(method);
+    }
+
+    @Override
+    public QName getOutParameterName(OperationInfo op, Method method, int paramNumber, boolean doc) {
+        // TODO Auto-generated method stub
+        return super.getOutParameterName(op, method, paramNumber, doc);
+    }
+
+    @Override
+    public QName getOutputMessageName(OperationInfo op) {
+        // TODO Auto-generated method stub
+        return super.getOutputMessageName(op);
+    }
+
+    @Override
+    public QName getInterfaceName() {
+        return new QName(getServiceNamespace(), getServiceName() + "PortType");
+    }
+
+    @Override
+    public String getServiceName() {
+        return getServiceFactory().getServiceClass().getSimpleName();
+    }
+
+    @Override
+    public String getServiceNamespace() {
+        return ServiceUtils.makeNamespaceFromClassName(getServiceFactory().getServiceClass().getName(),
+                                                       "http");
+    }
+
+    @Override
+    public Boolean hasOutMessage(String mep) {
+        // TODO Auto-generated method stub
+        return super.hasOutMessage(mep);
+    }
+
+    @Override
+    public Boolean isAsync(Method method) {
+        return Boolean.FALSE;
+    }
+
+    @Override
+    public Boolean isHeader(Method method, int j) {
+        return Boolean.FALSE;
+    }
+
+    @Override
+    public Boolean isInParam(Method method, int j) {
+        return j >= 0;
+    }
+
+    @Override
+    public Boolean isOperation(Method method) {
+        if (getServiceFactory().getIgnoredClasses().contains(method.getDeclaringClass().getName())) {
+            return Boolean.FALSE;
+        }
+
+        final int modifiers = method.getModifiers();
+
+        if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) {
+            return Boolean.TRUE;
+        }
+        return Boolean.FALSE;
+    }
+
+    @Override
+    public Boolean isOutParam(Method method, int j) {
+        return j < 0;
     }
 
 }

Added: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java?view=auto&rev=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java (added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java Sun Sep 24 13:55:22 2006
@@ -0,0 +1,34 @@
+/**
+ * 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.cxf.service.factory;
+
+import java.lang.reflect.Method;
+
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.service.model.BindingOperationInfo;
+
+/**
+ * Provides functionality to map BindingOperations to Methods and
+ * vis a versa.
+ */
+public interface MethodDispatcher {
+    Method getMethod(BindingOperationInfo op);
+    
+    BindingOperationInfo getBindingOperation(Method m, Endpoint endpoint);
+}

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/MethodDispatcher.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Sun Sep 24 13:55:22 2006
@@ -36,15 +36,22 @@
 import org.apache.cxf.helpers.MethodComparator;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.ServiceImpl;
+import org.apache.cxf.service.invoker.ApplicationScopePolicy;
+import org.apache.cxf.service.invoker.FactoryInvoker;
 import org.apache.cxf.service.invoker.Invoker;
-import org.apache.cxf.service.model.BindingInfo;
-import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.invoker.LocalFactory;
 import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.wsdl11.WSDLServiceFactory;
 
+/**
+ * Introspects a class and builds a {@link Service} from it. If a WSDL URL is specified, 
+ * a Service model will be directly from the WSDL and then metadata will be filled in 
+ * from the service class. If no WSDL URL is specified, the Service will be constructed
+ * directly from the class structure. 
+ */
 public class ReflectionServiceFactoryBean extends AbstractServiceFactoryBean {
 
     private static final Logger LOG = Logger.getLogger(ReflectionServiceFactoryBean.class.getName());
@@ -52,15 +59,24 @@
 
     protected URL wsdlURL;
 
-    private Class<?> serviceClass;
+    protected Class<?> serviceClass;
+    
     private List<AbstractServiceConfiguration> serviceConfigurations = 
         new ArrayList<AbstractServiceConfiguration>();
     private QName serviceName;
     private Invoker invoker;
     private Executor executor;
-
+    private List<String> ignoredClasses = new ArrayList<String>();
+    
     public ReflectionServiceFactoryBean() {
-        getServiceConfigurations().add(new DefaultServiceConfiguration());
+        getServiceConfigurations().add(0, new DefaultServiceConfiguration());
+        
+        ignoredClasses.add("java.lang.Object");
+        ignoredClasses.add("java.lang.Throwable");
+        ignoredClasses.add("org.omg.CORBA_2_3.portable.ObjectImpl");
+        ignoredClasses.add("org.omg.CORBA.portable.ObjectImpl");
+        ignoredClasses.add("javax.ejb.EJBObject");
+        ignoredClasses.add("javax.rmi.CORBA.Stub");
     }
 
     @Override
@@ -73,7 +89,12 @@
 
         initializeDefaultInterceptors();
 
-        getService().setInvoker(getInvoker());
+        if (invoker != null) {
+            getService().setInvoker(getInvoker());
+        } else {
+            getService().setInvoker(createInvoker());
+        }
+        
         if (getExecutor() != null) {
             getService().setExecutor(getExecutor());
         } else {
@@ -95,9 +116,7 @@
 
     protected void initializeServiceModel() {
         URL url = getWsdlURL();
-        if (getService() != null) {
-            return;
-        }
+
         if (url != null && doInitWSDLOperations()) {
             LOG.info("Creating Service " + getServiceQName() + " from WSDL.");
             WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), url, getServiceQName());
@@ -106,27 +125,25 @@
 
             initializeWSDLOperations();
         } else {
+            LOG.info("Creating Service " + getServiceQName() + " from class " + getServiceClass().getName());
             // If we can't find the wsdlLocation, then we should build a faked service model .            
             ServiceInfo serviceInfo = new ServiceInfo();
             serviceInfo.setName(getServiceQName());
             
-            BindingInfo bi = new BindingInfo(serviceInfo, getBindingType());          
-
-            EndpointInfo ei = new EndpointInfo(serviceInfo, bi.getBindingId());
-            ei.setName(getPortQName());
-            ei.setBinding(bi);
-            
-            serviceInfo.addEndpoint(ei);
-            
             createInterface(serviceInfo);
 
             ServiceImpl service = new ServiceImpl(serviceInfo);
             setService(service);
 
-            // TODO Add hooks to create default bindings
+            createBindings(service);
         }
     }
 
+    protected void createBindings(ServiceImpl service) {
+        // TODO Auto-generated method stub
+        
+    }
+
     protected boolean doInitWSDLOperations() {
         return true;
     }
@@ -166,6 +183,11 @@
 
     }
 
+    protected Invoker createInvoker() {
+        return new FactoryInvoker(new LocalFactory(getServiceClass()), 
+                                  new ApplicationScopePolicy());
+    }
+    
     protected ServiceInfo createServiceInfo(InterfaceInfo intf) {
         ServiceInfo svcInfo = new ServiceInfo();
         svcInfo.setInterface(intf);
@@ -183,8 +205,8 @@
         // so we have to append numbers to the name. Different JVMs sort methods
         // differently.
         // We need to keep them ordered so if we have overloaded methods, the
-        // wsdl is
-        // generated the same every time across JVMs and across client/servers.
+        // wsdl is generated the same every time across JVMs and across
+        // client/servers.
         Arrays.sort(methods, new MethodComparator());
 
         for (Method m : serviceClass.getMethods()) {
@@ -192,6 +214,7 @@
                 createOperation(serviceInfo, intf, m);
             }
         }
+        
         return intf;
     }
 
@@ -267,18 +290,13 @@
     }
     
     protected QName getPortQName() {
-        // TO be override
-        return null;
-    }
-    
-    protected String getBindingType() {
-        // to be override
-        return null;
-    }
-
-    protected QName getInterfaceName() {
-        // TODO Auto-generated method stub
-        return null;
+        for (AbstractServiceConfiguration c : serviceConfigurations) {
+            QName name = c.getInterfaceName();
+            if (name != null) {
+                return name;
+            }
+        }
+        throw new IllegalStateException("ServiceConfiguration must provide a value!");
     }
 
     protected String getServiceName() {
@@ -301,6 +319,16 @@
         throw new IllegalStateException("ServiceConfiguration must provide a value!");
     }
 
+    protected QName getInterfaceName() {
+        for (AbstractServiceConfiguration c : serviceConfigurations) {
+            QName name = c.getInterfaceName();
+            if (name != null) {
+                return name;
+            }
+        }
+        throw new IllegalStateException("ServiceConfiguration must provide a value!");
+    }
+
     protected boolean isValidMethod(final Method method) {
         for (AbstractServiceConfiguration c : serviceConfigurations) {
             Boolean b = c.isOperation(method);
@@ -312,6 +340,7 @@
     }
 
     protected boolean isMatchOperation(String methodNameInClass, String methodNameInWsdl) {
+        // TODO: This seems wrong and not sure who put it here. Will revisit - DBD
         boolean ret = false;
         String initOfMethodInClass = methodNameInClass.substring(0, 1);
         String initOfMethodInWsdl = methodNameInWsdl.substring(0, 1);
@@ -574,6 +603,12 @@
     public void setExecutor(Executor executor) {
         this.executor = executor;
     }
-    
-    
+
+    public List<String> getIgnoredClasses() {
+        return ignoredClasses;
+    }
+
+    public void setIgnoredClasses(List<String> ignoredClasses) {
+        this.ignoredClasses = ignoredClasses;
+    }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Sun Sep 24 13:55:22 2006
@@ -349,7 +349,7 @@
         }
 
         // RULE No.3:
-        // The output message part refers to a global element decalration
+        // The output message part refers to a global element declaration
         MessagePartInfo outputPart = null;
         if (outputMessage != null && outputMessage.size() == 1) {
             outputPart = outputMessage.getMessagePartByIndex(0);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java Sun Sep 24 13:55:22 2006
@@ -60,6 +60,9 @@
         }
         
         javax.wsdl.Service wsdlService = definition.getService(serviceName);
+        if (wsdlService == null) {
+            throw new ServiceConstructionException(new Message("NO_SUCH_SERVICE", LOG, serviceName));
+        }
         ServiceInfo si = new WSDLServiceBuilder(getBus()).buildService(definition, wsdlService);
         
         ServiceImpl service = new ServiceImpl(si);

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java Sun Sep 24 13:55:22 2006
@@ -158,6 +158,12 @@
         assertTrue(greetMeOneWay.hasInput());
         assertFalse(greetMeOneWay.hasOutput());
 
+        OperationInfo greetMeOneWayUnwrapped = greetMeOneWay.getUnwrappedOperation();
+        assertNotNull(greetMeOneWayUnwrapped);
+        assertNotNull(greetMeOneWayUnwrapped.getInput());
+        assertNull(greetMeOneWayUnwrapped.getOutput());
+        assertEquals("wrapped part not set", 1, greetMeOneWayUnwrapped.getInput().size());
+        
         name = new QName(serviceInfo.getName().getNamespaceURI(), "pingMe");
         OperationInfo pingMe = serviceInfo.getInterface().getOperation(name);
         assertNotNull(pingMe);

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java Sun Sep 24 13:55:22 2006
@@ -152,7 +152,9 @@
             }
         } else if (cls instanceof GenericArrayType) {
             GenericArrayType gt = (GenericArrayType)cls;
-            addType(gt.getGenericComponentType(), classes);
+            Class ct = (Class) gt.getGenericComponentType();
+            ct = Array.newInstance(ct, 0).getClass();
+            addType(ct, classes);
         }
     }
 

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java Sun Sep 24 13:55:22 2006
@@ -23,7 +23,6 @@
 import java.io.OutputStream;
 import java.lang.reflect.Method;
 
-import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
@@ -50,7 +49,6 @@
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.wsdl11.WSDLServiceFactory;
 import org.apache.hello_world_soap_http.Greeter;
-
 import org.easymock.classextension.IMocksControl;
 
 import static org.easymock.EasyMock.expect;
@@ -88,11 +86,10 @@
         service = factory.create();
         endpointInfo = service.getServiceInfo().getEndpoint(new QName(ns, "SoapPort"));
         endpoint = new EndpointImpl(bus, service, endpointInfo);
-        service.setDataReaderFactory(getTestReaderFactory(Greeter.class));
-        service.setDataWriterFactory(getTestWriterFactory(Greeter.class));
+        service.setDataBinding(new JAXBDataBinding(Greeter.class));
 
         operation = endpointInfo.getBinding().getOperation(new QName(ns, "greetMe"));
-        operation.getOperationInfo().setProperty(WrappedInInterceptor.SINGLE_WRAPPED_PART, Boolean.TRUE);
+        operation.getOperationInfo().setProperty(WrappedInInterceptor.WRAPPER_CLASS, Boolean.TRUE);
 
         message = new MessageImpl();
         Exchange exchange = new ExchangeImpl();
@@ -126,19 +123,5 @@
             }
         }
         return null;
-    }
-
-    protected JAXBDataReaderFactory getTestReaderFactory(Class<?> clz) throws Exception {
-        JAXBContext ctx = JAXBEncoderDecoder.createJAXBContextForClass(clz);
-        JAXBDataReaderFactory readerFacotry = new JAXBDataReaderFactory();
-        readerFacotry.setJAXBContext(ctx);
-        return readerFacotry;
-    }
-
-    protected JAXBDataWriterFactory getTestWriterFactory(Class<?> clz) throws Exception {
-        JAXBContext ctx = JAXBEncoderDecoder.createJAXBContextForClass(clz);
-        JAXBDataWriterFactory writerFacotry = new JAXBDataWriterFactory();
-        writerFacotry.setJAXBContext(ctx);
-        return writerFacotry;
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Sun Sep 24 13:55:22 2006
@@ -45,8 +45,10 @@
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.jaxws.support.JaxwsEndpointImpl;
 import org.apache.cxf.jaxws.support.JaxwsImplementorInfo;
+import org.apache.cxf.jaxws.support.ProviderServiceFactoryBean;
 import org.apache.cxf.resource.ResourceManager;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.ChainInitiationObserver;
 import org.apache.cxf.transport.MessageObserver;
@@ -65,7 +67,6 @@
     private ServerImpl server;
     private Service service;
     private JaxwsEndpointImpl endpoint;
-    
     private JaxwsImplementorInfo implInfo;
     
     @SuppressWarnings("unchecked")
@@ -73,28 +74,36 @@
         bus = b;
         implementor = i;
         // bindingURI = uri;
-
-        implInfo = new JaxwsImplementorInfo(implementor.getClass());
         // build up the Service model
-        JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(implInfo);
+        implInfo = new JaxwsImplementorInfo(implementor.getClass());
+        
+        AbstractServiceFactoryBean serviceFactory;
+        if (implInfo.isWebServiceProvider()) {
+            serviceFactory = new ProviderServiceFactoryBean(implInfo);
+        } else {
+            serviceFactory = new JaxWsServiceFactoryBean(implInfo);
+        }
         serviceFactory.setBus(bus);
-        serviceFactory.setServiceClass(implementor.getClass());
         service = serviceFactory.create();
 
-        // create the endpoint        
+        // create the endpoint       
         QName endpointName = implInfo.getEndpointName();
         EndpointInfo ei = service.getServiceInfo().getEndpoint(endpointName);
-        
+        if (ei == null) {
+            throw new NullPointerException("Could not find endpoint " + endpointName + " in Service.");
+        }
+ 
         // revisit: should get enableSchemaValidation from configuration
         if (false) {
             addSchemaValidation();
         }
-
+        
         if (implInfo.isWebServiceProvider()) {
             service.setInvoker(new ProviderInvoker((Provider<?>)i));
         } else {
             service.setInvoker(new JAXWSMethodInvoker(i));
         }
+        
         //      TODO: use bindigURI     
         try {
             endpoint = new JaxwsEndpointImpl(bus, service, ei);            
@@ -108,12 +117,12 @@
     private void addSchemaValidation() {
         Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfo());
         
-        if (service.getDataReaderFactory() instanceof JAXBDataReaderFactory) {
-            ((JAXBDataReaderFactory)service.getDataReaderFactory()).setSchema(schema);
+        if (service.getDataBinding().getDataReaderFactory() instanceof JAXBDataReaderFactory) {
+            ((JAXBDataReaderFactory)service.getDataBinding().getDataReaderFactory()).setSchema(schema);
         }
         
-        if (service.getDataWriterFactory() instanceof JAXBDataWriterFactory) {
-            ((JAXBDataWriterFactory)service.getDataWriterFactory()).setSchema(schema);
+        if (service.getDataBinding().getDataWriterFactory() instanceof JAXBDataWriterFactory) {
+            ((JAXBDataWriterFactory)service.getDataBinding().getDataWriterFactory()).setSchema(schema);
         }
     }
 
@@ -225,12 +234,13 @@
         }
         
         try {
-            MessageObserver observer = null;
+            MessageObserver observer;
             if (implInfo.isWebServiceProvider()) {
                 observer = new ProviderChainObserver(endpoint, bus, implInfo);
             } else {
                 observer = new ChainInitiationObserver(endpoint, bus);
-            }       
+            }
+     
             server = new ServerImpl(bus, endpoint, observer);
             server.start();
         } catch (BusException ex) {
@@ -238,6 +248,5 @@
         } catch (IOException ex) {
             throw new WebServiceException(BUNDLE.getString("FAILED_TO_PUBLISH_ENDPOINT_EXC"), ex);
         }
-
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java Sun Sep 24 13:55:22 2006
@@ -26,32 +26,22 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.FutureTask;
 import java.util.logging.Logger;
 
-import javax.jws.WebMethod;
-import javax.xml.namespace.QName;
 import javax.xml.ws.AsyncHandler;
 import javax.xml.ws.Binding;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Holder;
-import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.Response;
-import javax.xml.ws.ResponseWrapper;
 import javax.xml.ws.WebServiceException;
 
-import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Endpoint;
-import org.apache.cxf.interceptor.WrappedInInterceptor;
-import org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor;
-import org.apache.cxf.jaxws.support.JaxWsUtils;
+import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.model.BindingOperationInfo;
-import org.apache.cxf.service.model.InterfaceInfo;
-import org.apache.cxf.service.model.OperationInfo;
 
 public final class EndpointInvocationHandler extends BindingProviderImpl implements InvocationHandler {
 
@@ -63,8 +53,6 @@
 
     private Client client;
 
-    private Map<Method, BindingOperationInfo> infoMap = new ConcurrentHashMap<Method, BindingOperationInfo>();
-
     EndpointInvocationHandler(Client c, Binding b) {
         super(b);
         endpoint = c.getEndpoint();
@@ -72,29 +60,31 @@
     }
 
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-
-        BindingOperationInfo oi = getOperationInfo(proxy, method);
+        MethodDispatcher dispatcher = 
+            (MethodDispatcher)endpoint.getService().get(MethodDispatcher.class.getName());
+        BindingOperationInfo oi = dispatcher.getBindingOperation(method, endpoint);
         if (oi == null) {
-            //check for method on BindingProvider
+            // check for method on BindingProvider
             if (method.getDeclaringClass().equals(BindingProvider.class)
                 || method.getDeclaringClass().equals(BindingProviderImpl.class)) {
                 return method.invoke(this);
             }
-            
+
             Message msg = new Message("NO_OPERATION_INFO", LOG, method.getName());
             throw new WebServiceException(msg.toString());
         }
-
+       
         Object[] params = args;
         if (null == params) {
             params = new Object[0];
         }
-        JaxWsUtils.setClassInfo(oi.getOperationInfo(), null, method);
+
         Object[] paramsWithOutHolder = handleHolder(params);
         Map<String, Object> requestContext = this.getRequestContext();
         Map<String, Object> responseContext = this.getResponseContext();
-        
-        
+
+        requestContext.put(Method.class.getName(), method);
+
         boolean isAsync = method.getName().endsWith("Async");
         if (isAsync) {
             return invokeAsync(method, oi, params, paramsWithOutHolder, requestContext, responseContext);
@@ -103,6 +93,7 @@
         }
     }
 
+
     Object invokeSync(Method method, 
                           BindingOperationInfo oi, 
                           Object[] params, 
@@ -110,6 +101,7 @@
                           Map<String, Object> requestContext,
                           Map<String, Object> responseContext) {
         Object rawRet[] = client.invoke(oi, paramsWithOutHolder, requestContext, responseContext);
+
         if (rawRet != null && rawRet.length != 0) {
             List<Object> retList = new ArrayList<Object>();
             handleHolderReturn(params, method, rawRet, retList);
@@ -135,13 +127,14 @@
                                                                              requestContext,
                                                                              responseContext
                                                                              ));
+
         endpoint.getService().getExecutor().execute(f);
-        
-        Response<?> r = new AsyncResponse<Object>(f, Object.class); 
+
+        Response<?> r = new AsyncResponse<Object>(f, Object.class);
         if (params.length > 0 && params[params.length - 1] instanceof AsyncHandler) {
-            //          callback style
-            AsyncCallbackFuture callback = new AsyncCallbackFuture(r, 
-                (AsyncHandler)params[params.length - 1]);
+            // callback style
+            AsyncCallbackFuture callback = 
+                new AsyncCallbackFuture(r, (AsyncHandler)params[params.length - 1]);
             endpoint.getService().getExecutor().execute(callback);
             return callback;
         } else {
@@ -150,7 +143,7 @@
     }
 
     private Object[] handleHolder(Object[] params) {
-        //get value out of Holder
+        // get value out of Holder
         Object[] ret = new Object[params.length];
         for (int i = 0; i < params.length; i++) {
             if (params[i] instanceof Holder) {
@@ -162,66 +155,10 @@
         return ret;
     }
 
-    BindingOperationInfo getOperationInfo(Object proxy, Method method) {
-        // TODO: We can't really just associate a method with the operationInfo
-        // by its name. The operation name in the wsdl might be something
-        // different.
-        // For instance, if we have two methods named Foo, there might bee Foo1
-        // and Foo2 since the WS-I BP disallows operations with the same name.
-
-        BindingOperationInfo boi = infoMap.get(method);
-
-        if (null == boi) {
-            WebMethod wma = method.getAnnotation(WebMethod.class);
-            String operationName = null;
-            if (null != wma && !"".equals(wma.operationName())) {
-                operationName = wma.operationName();
-            } else {
-                operationName = method.getName();
-            }
-
-            InterfaceInfo ii = endpoint.getService().getServiceInfo().getInterface();
-            QName oiQName = new QName(endpoint.getService().getName().getNamespaceURI(), operationName);
-            OperationInfo oi = ii.getOperation(oiQName);
-            if (null == oi) {
-                return null;
-            }
-            // found the OI in the Interface, now find it in the binding
-            BindingOperationInfo boi2 = endpoint.getEndpointInfo().getBinding().getOperation(oiQName);
-            if (boi2.getOperationInfo() == oi) {
-                if (boi2.isUnwrappedCapable()) {
-                    try {
-                        Class requestWrapper = getRequestWrapper(method);
-                        Class responseWrapper = getResponseWrapper(method);
-
-                        if (requestWrapper != null || responseWrapper != null) {
-                            BindingOperationInfo boi3 = boi2.getUnwrappedOperation();
-                            oi = boi3.getOperationInfo();
-                            oi.setProperty(WrapperClassOutInterceptor.SINGLE_WRAPPED_PART, requestWrapper);
-                            boi2.getOperationInfo().setProperty(WrappedInInterceptor.SINGLE_WRAPPED_PART,
-                                            Boolean.TRUE);
-                            boi3.getOperationInfo().setProperty(Method.class.getName(), method);
-                            infoMap.put(method, boi3);
-                            return boi3;
-                        }
-                    } catch (ClassNotFoundException cnfe) {
-                        cnfe.printStackTrace();
-                        // TODO - exception
-                    }
-                }
-                boi2.getOperationInfo().setProperty(Method.class.getName(), method);
-                infoMap.put(method, boi2);                
-                return boi2;
-            }
-        }
-        return boi;
-    }
-    
-    
     private void handleHolderReturn(Object[] params, Method method, Object[] rawRet, List<Object> retList) {
-                
+
         int idx = 0;
-        
+
         if (method == null) {
             return;
         }
@@ -243,11 +180,11 @@
                 holderStartIndex++;
             }
         }
-                    
+
         for (int i = idx; i < rawRet.length; i++, holderStartIndex++) {
             try {
-                ((Holder)params[holderStartIndex]).getClass().getField(
-                    "value").set(params[holderStartIndex], rawRet[i]);
+                ((Holder)params[holderStartIndex]).getClass().getField("value").set(params[holderStartIndex],
+                                                                                    rawRet[i]);
             } catch (IllegalArgumentException e) {
                 e.printStackTrace();
             } catch (SecurityException e) {
@@ -257,27 +194,7 @@
             } catch (NoSuchFieldException e) {
                 e.printStackTrace();
             }
-            
-        }
-    }
-
-
-    protected Class getResponseWrapper(Method selected) throws ClassNotFoundException {
-        ResponseWrapper rw = selected.getAnnotation(ResponseWrapper.class);
-        if (rw == null) {
-            return null;
-        }
-        String cn = rw.className();
-        return ClassLoaderUtils.loadClass(cn, selected.getDeclaringClass());
-    }
 
-    protected Class getRequestWrapper(Method selected) throws ClassNotFoundException {
-        RequestWrapper rw = selected.getAnnotation(RequestWrapper.class);
-        if (rw == null) {
-            return null;
         }
-        String cn = rw.className();
-        return ClassLoaderUtils.loadClass(cn, selected.getDeclaringClass());
     }
-
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?view=diff&rev=449480&r1=449479&r2=449480
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java Sun Sep 24 13:55:22 2006
@@ -21,6 +21,7 @@
 
 package org.apache.cxf.jaxws;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -32,6 +33,8 @@
 
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
 
@@ -48,8 +51,9 @@
     public Object invoke(Exchange exchange, Object o) {
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
         
-        
-        Method m = (Method)bop.getOperationInfo().getProperty(Method.class.getName());
+        MethodDispatcher md = (MethodDispatcher) 
+            exchange.get(Service.class).get(MethodDispatcher.class.getName());
+        Method m = md.getMethod(bop);
         List<Object> params = (List<Object>) o;
                 
         checkHolder(m, params, exchange);
@@ -70,8 +74,16 @@
                 }
             }
             return Arrays.asList(retList.toArray());
-        } catch (Exception e) {
+        } catch (IllegalAccessException e) {
+            throw new Fault(e);
+        } catch (IllegalArgumentException e) {
             throw new Fault(e);
+        } catch (InvocationTargetException e) {
+            Throwable target = e;
+            if (e.getCause() instanceof Exception) {
+                target = e.getCause();
+            }
+            throw new Fault(target);
         }
     }
 



Mime
View raw message