cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r553285 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/phase/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/ rt/frontend/jaxws/src/main/java/org/apache/cxf/...
Date Wed, 04 Jul 2007 18:06:56 GMT
Author: jliu
Date: Wed Jul  4 11:06:54 2007
New Revision: 553285

URL: http://svn.apache.org/viewvc?view=rev&rev=553285
Log:
* CXF-747. Remove unnecessary interceptors for Provider.
* Use same DispatchIn/DispatchOut data binding interceptors for Dispatch and Provider.

Added:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachementServer.java   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/XMLServer.java   (with props)
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.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/DispatchOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/SAAJProvider.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderXMLClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/Server.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/TestProvider.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.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=553285&r1=553284&r2=553285
==============================================================================
--- 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 Wed Jul  4 11:06:54 2007
@@ -203,6 +203,7 @@
                 if (LOG.isLoggable(Level.FINE)) {
                     LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor);
                 }
+                //System.out.println("-----------" + currentInterceptor);
                 currentInterceptor.handleMessage(message);
                 
             } catch (RuntimeException ex) {

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=553285&r1=553284&r2=553285
==============================================================================
--- 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 Wed Jul  4 11:06:54 2007
@@ -96,8 +96,6 @@
     public static final String SOAP_11_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/";
     public static final String SOAP_12_BINDING = "http://schemas.xmlsoap.org/wsdl/soap12/";
     
-    public static final String MESSAGE_PROCESSING_DISABLED = "disable.header.processing";
-    
     private boolean mtomEnabled = true;
 
     public BindingInfo createBindingInfo(ServiceInfo si, String bindingid, Object conf) {
@@ -323,16 +321,17 @@
             throw new RuntimeException("Can not initialize SoapBinding, BindingInfo is not SoapBindingInfo");
         }
 
-        sb.getInInterceptors().add(new AttachmentInInterceptor());
-        sb.getInInterceptors().add(new StaxInInterceptor()); 
-        
-        sb.getOutInterceptors().add(new SoapActionInterceptor());
-        sb.getOutInterceptors().add(new AttachmentOutInterceptor());
-        sb.getOutInterceptors().add(new StaxOutInterceptor());
-        
         sb.getOutFaultInterceptors().add(new StaxOutInterceptor());
 
+        //Do not add any interceptors if it is Provider/Dispatch
         if (!Boolean.TRUE.equals(binding.getProperty(DATABINDING_DISABLED))) {
+            sb.getInInterceptors().add(new AttachmentInInterceptor());
+            sb.getInInterceptors().add(new StaxInInterceptor());             
+            
+            sb.getOutInterceptors().add(new SoapActionInterceptor());
+            sb.getOutInterceptors().add(new AttachmentOutInterceptor());
+            sb.getOutInterceptors().add(new StaxOutInterceptor());                     
+            
             if (SoapConstants.BINDING_STYLE_RPC.equalsIgnoreCase(bindingStyle)) {
                 sb.getInInterceptors().add(new RPCInInterceptor());
                 sb.getOutInterceptors().add(new RPCOutInterceptor());
@@ -348,9 +347,7 @@
                 sb.getOutInterceptors().add(new BareOutInterceptor());
             }
             sb.getInInterceptors().add(new SoapHeaderInterceptor());
-        }
-        
-        if (!Boolean.TRUE.equals(binding.getProperty(MESSAGE_PROCESSING_DISABLED))) {
+            
             sb.getInInterceptors().add(new ReadHeadersInterceptor(getBus()));
             sb.getInInterceptors().add(new MustUnderstandInterceptor());
             sb.getOutInterceptors().add(new SoapPreProtocolOutInterceptor());
@@ -360,9 +357,9 @@
             // REVISIT: The phase interceptor chain seems to freak out if this added
             // first. Not sure what the deal is at the moment, I suspect the
             // ordering algorithm needs to be improved
-            sb.getInInterceptors().add(new URIMappingInterceptor());
+            sb.getInInterceptors().add(new URIMappingInterceptor());          
         }
-        
+
         if (version.getVersion() == 1.1) {
             sb.getInFaultInterceptors().add(new Soap11FaultInInterceptor());
             sb.getOutFaultInterceptors().add(new Soap11FaultOutInterceptor());

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLBindingFactory.java Wed Jul  4 11:06:54 2007
@@ -37,29 +37,22 @@
 import org.apache.cxf.service.model.ServiceInfo;
 
 public class XMLBindingFactory extends AbstractBindingFactory {
-
-    public static final String XML_PARSER_DISABLED = "xml.parser.disabled";
-    public static final String ATTACHMENT_PARSER_DISABLED = "xml.parser.disabled";
     
     public Binding createBinding(BindingInfo binding) {
         XMLBinding xb = new XMLBinding(binding);
-        if (!Boolean.TRUE.equals(binding.getProperty(ATTACHMENT_PARSER_DISABLED))) {
-            xb.getInInterceptors().add(new AttachmentInInterceptor());
-        }
-        if (!Boolean.TRUE.equals(binding.getProperty(XML_PARSER_DISABLED))) {
-            xb.getInInterceptors().add(new StaxInInterceptor());
-        }
-        xb.getInFaultInterceptors().add(new XMLFaultInInterceptor());
-        
-        xb.getOutInterceptors().add(new StaxOutInterceptor());
         
         if (!Boolean.TRUE.equals(binding.getProperty(DATABINDING_DISABLED))) {
+            xb.getInInterceptors().add(new AttachmentInInterceptor());    
+            xb.getInInterceptors().add(new StaxInInterceptor());
+            xb.getOutInterceptors().add(new StaxOutInterceptor());
+            
             xb.getInInterceptors().add(new URIMappingInterceptor());
             xb.getOutInterceptors().add(new XMLMessageOutInterceptor());
             xb.getInInterceptors().add(new DocLiteralInInterceptor());
             xb.getInInterceptors().add(new XMLMessageInInterceptor());
-        }
-        
+        }        
+
+        xb.getInFaultInterceptors().add(new XMLFaultInInterceptor());
         xb.getOutFaultInterceptors().add(new StaxOutInterceptor());
         xb.getOutFaultInterceptors().add(new XMLFaultOutInterceptor());
         

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java Wed Jul  4 11:06:54 2007
@@ -246,7 +246,7 @@
         
         chain.add(new MessageSenderInterceptor());
 
-        chain.add(new DispatchOutInterceptor());
+        chain.add(new DispatchOutInterceptor(mode));
         return chain;
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java Wed Jul  4 11:06:54 2007
@@ -22,17 +22,12 @@
 
 import java.util.List;
 
-import javax.activation.DataSource;
-import javax.xml.soap.SOAPMessage;
 import javax.xml.ws.WebServiceException;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.soap.SOAPBinding;
 
 import org.apache.cxf.binding.AbstractBindingFactory;
 import org.apache.cxf.binding.soap.Soap12;
-import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.model.SoapBindingInfo;
-import org.apache.cxf.binding.xml.XMLBindingFactory;
 import org.apache.cxf.common.injection.ResourceInjector;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.ServerFactoryBean;
@@ -102,8 +97,6 @@
                 setBindingConfig(new JaxWsSoapBindingConfiguration(sf));
             }
         }
-            
-        boolean messageMode = implInfo.getServiceMode().equals(javax.xml.ws.Service.Mode.MESSAGE);
         
         if (getBindingConfig() instanceof JaxWsSoapBindingConfiguration) {
             JaxWsSoapBindingConfiguration conf = (JaxWsSoapBindingConfiguration)getBindingConfig();
@@ -123,24 +116,12 @@
             conf.setJaxWsServiceFactoryBean(sf);
         }
         
-        BindingInfo bindingInfo = super.createBindingInfo();
-            
-        // This disables a bunch of unwanted interceptors for the Provider scenario. 
-        // Not ideal, but it works.
+        BindingInfo bindingInfo = super.createBindingInfo();        
+
         if (implInfo.isWebServiceProvider()) {
             bindingInfo.setProperty(AbstractBindingFactory.DATABINDING_DISABLED, Boolean.TRUE);
-            
-            if ((bindingInfo instanceof SoapBindingInfo) 
-                && messageMode
-                && !implInfo.getProviderParameterType().equals(SOAPMessage.class)) {
-                bindingInfo.setProperty(SoapBindingFactory.MESSAGE_PROCESSING_DISABLED, Boolean.TRUE);
-            }
-            if (implInfo.getProviderParameterType().equals(DataSource.class)) {
-                bindingInfo.setProperty(XMLBindingFactory.XML_PARSER_DISABLED, Boolean.TRUE);
-                bindingInfo.setProperty(XMLBindingFactory.ATTACHMENT_PARSER_DISABLED, Boolean.TRUE);
-            }
         }
-            
+
         return bindingInfo;
     }
     

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInInterceptor.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInInterceptor.java Wed Jul  4 11:06:54 2007
@@ -21,6 +21,8 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.logging.Logger;
 
 import javax.activation.DataSource;
@@ -45,14 +47,17 @@
 import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.StaxInInterceptor;
 import org.apache.cxf.jaxb.JAXBDataBinding;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.XMLMessage;
 import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 
 public class DispatchInInterceptor extends AbstractInDatabindingInterceptor {
@@ -69,12 +74,24 @@
     }
 
     public void handleMessage(Message message) throws Fault {
+        Exchange ex = message.getExchange();     
+        Endpoint ep = ex.get(Endpoint.class);
+        
+        if (ep.getEndpointInfo().getBinding().getOperations().iterator().hasNext()) {
+            BindingOperationInfo bop = ep.getEndpointInfo().getBinding().getOperations().iterator().next();
+            ex.put(BindingOperationInfo.class, bop);
+            getMessageInfo(message, bop);
+        }
+        
+        List<Object> params = new ArrayList<Object>();          
         
         if (isGET(message)) {
+            params.add(null);
+            message.setContent(List.class, params);
             LOG.info("DispatchInInterceptor skipped in HTTP GET method");
             return;
-        }
-
+        }       
+     
         try {
             InputStream is = message.getContent(InputStream.class);
             Object obj = null;
@@ -124,7 +141,7 @@
                     }
                     obj = dataReader.read(null, message.getContent(XMLStreamReader.class), readType);
                     
-                    if (!type.equals(Source.class)) {
+                    if (!Source.class.isAssignableFrom(type)) {
                         //JAXB, need to make a Source format available for Logical handler                   
                         DataWriter<XMLStreamWriter> dataWriter =
                             service.getDataBinding().createWriter(XMLStreamWriter.class);
@@ -136,8 +153,10 @@
                     }
                 }
             }
+            params.add(obj);           
+            message.setContent(Object.class, obj);    
+            message.setContent(List.class, params);
             
-            message.setContent(Object.class, obj);
             is.close();
         } catch (Exception e) {
             throw new Fault(e);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutInterceptor.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchOutInterceptor.java Wed Jul  4 11:06:54 2007
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.List;
 import java.util.logging.Logger;
 
 import javax.activation.DataSource;
@@ -36,6 +37,7 @@
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
 
 import org.w3c.dom.Node;
 
@@ -55,24 +57,35 @@
 public class DispatchOutInterceptor extends AbstractOutDatabindingInterceptor {
     private static final Logger LOG = LogUtils.getL7dLogger(DispatchOutInterceptor.class);
     private DispatchOutEndingInterceptor ending;
-
-    public DispatchOutInterceptor() {
+    
+    private Service.Mode mode;
+    
+    public DispatchOutInterceptor(Mode mode) {
         super(Phase.WRITE);
         ending = new DispatchOutEndingInterceptor();
+        
+        this.mode = mode;
     }
 
     public void handleMessage(Message message) throws Fault {
-        Service.Mode m = message.getExchange().get(Service.Mode.class);
-        Object obj = message.getContent(Object.class);
         org.apache.cxf.service.Service service = 
             message.getExchange().get(org.apache.cxf.service.Service.class);
-        
+
+        Object obj = null;
+        Object result = message.getContent(List.class);
+        if (result != null) {
+            obj = ((List)result).get(0);
+            message.setContent(Object.class, obj);
+        } else {
+            obj = message.getContent(Object.class);
+        }
+
         if (obj == null) {
             throw new Fault(new org.apache.cxf.common.i18n.Message("DISPATCH_OBJECT_CANNOT_BE_NULL", LOG));
         }
 
         if (message instanceof SoapMessage) {
-            if (m == Service.Mode.PAYLOAD) {
+            if (mode == Service.Mode.PAYLOAD) {
                 if (obj instanceof SOAPMessage || obj instanceof DataSource) {
                     throw new Fault(
                                     new org.apache.cxf.common.i18n.Message(
@@ -112,7 +125,7 @@
                                     LOG, "SOAPMessage", "PAYLOAD/MESSAGE"));
             }
 
-            if (m == Service.Mode.PAYLOAD && obj instanceof DataSource) {
+            if (mode == Service.Mode.PAYLOAD && obj instanceof DataSource) {
                 throw new Fault(
                                 new org.apache.cxf.common.i18n.Message(
                                     "DISPATCH_OBJECT_NOT_SUPPORTED_XMLBINDING",
@@ -162,6 +175,7 @@
                 // Finish the message processing, do flush
                 os.flush();
             } catch (Exception ex) {
+                ex.printStackTrace();
                 throw new Fault(new org.apache.cxf.common.i18n.Message("EXCEPTION_WRITING_OBJECT", LOG));
             }
         }      

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java Wed Jul  4 11:06:54 2007
@@ -34,7 +34,6 @@
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
@@ -44,11 +43,10 @@
 
 public class ProviderInDatabindingInterceptor extends AbstractInDatabindingInterceptor {
 
-    Class type;
+    private Class type;
 
     public ProviderInDatabindingInterceptor(Class type) {
-        super(Phase.UNMARSHAL);
-        addAfter(URIMappingInterceptor.class.getName());
+        super(Phase.PRE_STREAM);
         this.type = type;
     }
 
@@ -106,9 +104,5 @@
             }
         }
         message.setContent(Object.class, params);
-
-    }
-    
-    
-
+    } 
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java Wed Jul  4 11:06:54 2007
@@ -61,33 +61,52 @@
 public class JaxWsEndpointImpl extends EndpointImpl {
 
     private Binding jaxwsBinding;
+    private JaxWsImplementorInfo implInfo; 
     
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei) throws EndpointException {
-        super(bus, s, ei);
+        this(bus, s, ei, null);
+    }
 
+    public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei, JaxWsImplementorInfo implementorInfo)
+        throws EndpointException {
+        super(bus, s, ei);
+        this.implInfo = implementorInfo;
+        
         createJaxwsBinding();
-
-        //Inbound chain
-        List<Interceptor> in = super.getInInterceptors();
-        in.add(new LogicalHandlerInInterceptor(jaxwsBinding));
-        in.add(new WrapperClassInInterceptor());
-        in.add(new HolderInInterceptor());
-        if (getBinding() instanceof SoapBinding) {
-            in.add(new SOAPHandlerInterceptor(jaxwsBinding));
-            in.add(new SwAInInterceptor());
-            getOutInterceptors().add(new SwAOutInterceptor());
-        } else {
-             // TODO: what for non soap bindings?
-        }
         
-        //Outbound chain       
+        List<Interceptor> in = super.getInInterceptors();       
         List<Interceptor> out = super.getOutInterceptors();
-        out.add(new LogicalHandlerOutInterceptor(jaxwsBinding));
-        out.add(new WrapperClassOutInterceptor());
-        out.add(new HolderOutInterceptor());       
-        if (getBinding() instanceof SoapBinding) {
-            out.add(new SOAPHandlerInterceptor(jaxwsBinding));
+        
+        if (implInfo != null && implInfo.isWebServiceProvider()) {
+            in.add(new LogicalHandlerInInterceptor(jaxwsBinding));
+            out.add(new LogicalHandlerOutInterceptor(jaxwsBinding));
+
+            if (getBinding() instanceof SoapBinding) {
+                in.add(new SOAPHandlerInterceptor(jaxwsBinding));
+                out.add(new SOAPHandlerInterceptor(jaxwsBinding));
+            } 
+        } else {
+            // Inbound chain
+            in.add(new LogicalHandlerInInterceptor(jaxwsBinding));
+            in.add(new WrapperClassInInterceptor());
+            in.add(new HolderInInterceptor());
+            if (getBinding() instanceof SoapBinding) {
+                in.add(new SOAPHandlerInterceptor(jaxwsBinding));
+                in.add(new SwAInInterceptor());
+                getOutInterceptors().add(new SwAOutInterceptor());
+            } else {
+                // TODO: what for non soap bindings?
+            }
+
+            // Outbound chain
+            out.add(new LogicalHandlerOutInterceptor(jaxwsBinding));
+            out.add(new WrapperClassOutInterceptor());
+            out.add(new HolderOutInterceptor());
+            if (getBinding() instanceof SoapBinding) {
+                out.add(new SOAPHandlerInterceptor(jaxwsBinding));
+            }
         }
+      
         
         //Outbound fault chain
         List<Interceptor> outFault = super.getOutFaultInterceptors();    

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java Wed Jul  4 11:06:54 2007
@@ -29,15 +29,11 @@
 
 import javax.wsdl.Operation;
 import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPMessage;
 import javax.xml.ws.AsyncHandler;
 import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
 
 import org.apache.cxf.binding.AbstractBindingFactory;
-import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.model.SoapBindingInfo;
-import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
-import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.databinding.source.SourceDataBinding;
@@ -46,11 +42,9 @@
 import org.apache.cxf.frontend.SimpleMethodDispatcher;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxws.JAXWSMethodDispatcher;
-import org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor;
-import org.apache.cxf.jaxws.interceptors.ProviderInDatabindingInterceptor;
-import org.apache.cxf.jaxws.interceptors.ProviderOutDatabindingInterceptor;
+import org.apache.cxf.jaxws.interceptors.DispatchInInterceptor;
+import org.apache.cxf.jaxws.interceptors.DispatchOutInterceptor;
 import org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor;
-import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.factory.AbstractServiceConfiguration;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
@@ -120,36 +114,16 @@
 
         if (implInfo.isWebServiceProvider()) {
             Class<?> type = implInfo.getProviderParameterType();
-            if (type.equals(SOAPMessage.class)) {
-                getService().getInInterceptors().add(new ProviderInDatabindingInterceptor(type));
-                // hack to get the SOAPMessage set before the SOAPHandlerInterceptor
-                ProviderOutDatabindingInterceptor out 
-                    = new ProviderOutDatabindingInterceptor(Phase.PRE_PROTOCOL);
-                out.addBefore(SOAPHandlerInterceptor.class.getName());
-                getService().getOutInterceptors().add(out);
-                
-                getService().getInInterceptors().add(new SAAJInInterceptor());
-                getService().getOutInterceptors().add(new SAAJOutInterceptor());
-            } else {
-                getService().getInInterceptors().add(new ProviderInDatabindingInterceptor(type));
-                getService().getOutInterceptors().add(new ProviderOutDatabindingInterceptor());
-            }
-
-            boolean messageMode = implInfo.getServiceMode().equals(javax.xml.ws.Service.Mode.MESSAGE);
-            if (getEndpointInfo() != null) {
-                for (BindingInfo bi : getEndpointInfo().getService().getBindings()) {
-                    if ((bi instanceof SoapBindingInfo) 
-                        && messageMode && !type.equals(SOAPMessage.class)) {
-                        bi.setProperty(SoapBindingFactory.MESSAGE_PROCESSING_DISABLED, Boolean.TRUE);
-                    }
-                }
-            }
+            Mode mode = implInfo.getServiceMode();
+
+            getService().getInInterceptors().add(new DispatchInInterceptor(type, mode));
+            getService().getOutInterceptors().add(new DispatchOutInterceptor(mode));
         }
     }
 
     @Override
     public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException {
-        return new JaxWsEndpointImpl(getBus(), getService(), ei);
+        return new JaxWsEndpointImpl(getBus(), getService(), ei, implInfo);
     }
 
     @Override

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/SAAJProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/SAAJProvider.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/SAAJProvider.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/SAAJProvider.java Wed Jul  4 11:06:54 2007
@@ -21,9 +21,12 @@
 
 import javax.xml.soap.SOAPMessage;
 import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
 import javax.xml.ws.WebServiceProvider;
 
 @WebServiceProvider()
+@ServiceMode(value = Service.Mode.MESSAGE)
 public class SAAJProvider implements Provider<SOAPMessage> {
 
     public SAAJProvider() {

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachementServer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachementServer.java?view=auto&rev=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachementServer.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachementServer.java Wed Jul  4 11:06:54 2007
@@ -0,0 +1,45 @@
+/**
+ * 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.systest.provider;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class AttachementServer extends AbstractBusTestServerBase {
+
+    protected void run() {
+        Object implementor = new AttachmentStreamSourceXMLProvider();
+        String address = "http://localhost:9033/XMLServiceAttachment";
+        Endpoint.publish(address, implementor);
+    }
+
+    public static void main(String[] args) {
+        try {
+            AttachementServer s = new AttachementServer();
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally {
+            System.out.println("done!");
+        }
+    }
+}
\ No newline at end of file

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachementServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachementServer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/AttachmentProviderXMLClientServerTest.java Wed Jul  4 11:06:54 2007
@@ -25,7 +25,6 @@
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.ws.Endpoint;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -34,40 +33,20 @@
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class AttachmentProviderXMLClientServerTest extends AbstractBusClientServerTestBase {
 
-    public static class Server extends AbstractBusTestServerBase {
-
-        protected void run() {
-            Object implementor = new AttachmentStreamSourceXMLProvider();
-            String address = "http://localhost:9033/XMLServiceAttachment";
-            Endpoint.publish(address, implementor);
-        }
-
-        public static void main(String[] args) {
-            try {
-                Server s = new Server();
-                s.start();
-            } catch (Exception ex) {
-                ex.printStackTrace();
-                System.exit(-1);
-            } finally {
-                System.out.println("done!");
-            }
-        }
-    }
-
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                launchServer(Server.class, true));
+                launchServer(AttachementServer.class, true));
     }
 
     @Test
+    @Ignore("REVISIT: I do not think it is valid to use Provider to receive a StreamSource with attachement")
     public void testRequestWithAttachment() throws Exception {
         
         HttpURLConnection connection =  

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java Wed Jul  4 11:06:54 2007
@@ -29,9 +29,11 @@
 import javax.xml.ws.Service;
 import javax.xml.ws.ServiceMode;
 import javax.xml.ws.WebServiceProvider;
-
 import org.w3c.dom.Node;
 
+import org.apache.cxf.helpers.XMLUtils;
+
+
 //The following wsdl file is used.
 //wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
 @WebServiceProvider(portName = "SoapPortProviderRPCLit2", serviceName = "SOAPServiceProviderRPCLit",
@@ -62,6 +64,7 @@
     }
 
     public DOMSource invoke(DOMSource request) {
+        XMLUtils.writeTo(request, System.out);
         DOMSource response = new DOMSource();
         try {
             SOAPMessage msg = factory.createMessage();

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java Wed Jul  4 11:06:54 2007
@@ -22,13 +22,11 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceProvider;
 
-import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
 //The following wsdl file is used.
@@ -61,11 +59,11 @@
     public DOMSource invoke(DOMSource request) {
         DOMSource response = new DOMSource();
         try {
-            SOAPMessage msg = factory.createMessage();            
+/*            SOAPMessage msg = factory.createMessage();            
             SOAPBody body = msg.getSOAPBody();
-            body.addDocument((Document)request.getNode());
+            body.addDocument((Document)request.getNode());*/
 
-            Node n = getElementChildNode(body);
+            Node n = request.getNode();
             if (n.getLocalName().equals(sayHi.getLocalPart())) {
                 response.setNode(sayHiResponse.getSOAPBody().extractContentAsDocument());
             } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
@@ -76,7 +74,7 @@
         }
         return response;
     }
-    
+/*    
     private Node getElementChildNode(SOAPBody body) {
         Node n = body.getFirstChild();
 
@@ -85,5 +83,5 @@
         }
         
         return n;        
-    }
+    }*/
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderXMLClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderXMLClientServerTest.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderXMLClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/ProviderXMLClientServerTest.java Wed Jul  4 11:06:54 2007
@@ -25,7 +25,6 @@
 import javax.xml.namespace.QName;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.ws.Dispatch;
-import javax.xml.ws.Endpoint;
 import javax.xml.ws.Service;
 
 import org.w3c.dom.Document;
@@ -33,7 +32,6 @@
 
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.apache.hello_world_xml_http.wrapped.XMLService;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -45,31 +43,10 @@
     private final QName portName = new QName(
             "http://apache.org/hello_world_xml_http/wrapped", "XMLProviderPort");
 
-    public static class Server extends AbstractBusTestServerBase {
-
-        protected void run() {
-            Object implementor = new HWDOMSourcePayloadXMLBindingProvider();
-            String address = "http://localhost:9022/XMLService/XMLProviderPort";
-            Endpoint.publish(address, implementor);
-        }
-
-        public static void main(String[] args) {
-            try {
-                Server s = new Server();
-                s.start();
-            } catch (Exception ex) {
-                ex.printStackTrace();
-                System.exit(-1);
-            } finally {
-                System.out.println("done!");
-            }
-        }
-    }
-
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly",
-                launchServer(Server.class));
+                launchServer(XMLServer.class));
     }
 
     @Test

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/Server.java Wed Jul  4 11:06:54 2007
@@ -33,7 +33,7 @@
         implementor = new HWDOMSourceMessageProvider();
         address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit2";
         Endpoint.publish(address, implementor);
-
+        
         implementor = new HWDOMSourcePayloadProvider();
         address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit3";
         Endpoint.publish(address, implementor);
@@ -53,6 +53,7 @@
         implementor = new HWStreamSourcePayloadProvider();
         address = "http://localhost:9008/SOAPServiceProviderRPCLit/SoapPortProviderRPCLit7";
         Endpoint.publish(address, implementor);
+    
     }
 
     public static void main(String[] args) {

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/XMLServer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/XMLServer.java?view=auto&rev=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/XMLServer.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/XMLServer.java Wed Jul  4 11:06:54 2007
@@ -0,0 +1,45 @@
+/**
+ * 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.systest.provider;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class XMLServer extends AbstractBusTestServerBase {
+
+    protected void run() {
+        Object implementor = new HWDOMSourcePayloadXMLBindingProvider();
+        String address = "http://localhost:9022/XMLService/XMLProviderPort";
+        Endpoint.publish(address, implementor);
+    }
+
+    public static void main(String[] args) {
+        try {
+            XMLServer s = new XMLServer();
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally {
+            System.out.println("done!");
+        }
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/XMLServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/XMLServer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/DataSourceProviderTest.java Wed Jul  4 11:06:54 2007
@@ -40,23 +40,22 @@
 import javax.xml.transform.stream.StreamSource;
 
 import org.apache.cxf.helpers.IOUtils;
-import org.junit.Assert;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
-public class DataSourceProviderTest extends Assert {
+public class DataSourceProviderTest extends AbstractBusClientServerTestBase {
 
     static final Logger LOG = Logger.getLogger(DataSourceProviderTest.class.getName());
-    private static final String TEST_URI = "http://localhost:9000/test/foo";
     private static final String BOUNDARY = "----=_Part_4_701508.1145579811786";
     private HttpURLConnection conn;
     private URL url;
 
-    @Before 
-    public void launchServer() { 
-        TestProvider tp = new TestProvider();
-        tp.publish(TEST_URI);
-        
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly",
+                launchServer(Server.class, true));
     }
     
     @Before

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/Server.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/Server.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/Server.java Wed Jul  4 11:06:54 2007
@@ -19,23 +19,25 @@
 
 package org.apache.cxf.systest.provider.datasource;
 
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
-public class Server {
+
+public class Server extends AbstractBusTestServerBase {
     
-    public void publish() { 
-            
+    protected void run() {            
         TestProvider servant = new TestProvider();
         servant.publish("http://localhost:9000/test/foo");
     }
     
     public static void main(String[] args) throws Exception { 
-        System.out.println("server starting");
-        
-        Server srv = new Server(); 
-        srv.publish();
-
-        Thread.sleep(60 * 60 * 1000);
-        System.out.println("Server exiting");
-        System.exit(0);
+        try {
+            Server s = new Server();
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally {
+            System.out.println("done!");
+        }
     }
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/TestProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/TestProvider.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/TestProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/datasource/TestProvider.java Wed Jul  4 11:06:54 2007
@@ -41,8 +41,8 @@
 
 
 @WebServiceProvider(serviceName = "ModelProvider")
-@ServiceMode(value = Service.Mode.PAYLOAD)
 @BindingType(value = "http://cxf.apache.org/bindings/xformat")
+@ServiceMode(value = Service.Mode.MESSAGE)
 public class TestProvider extends AbstractProvider<DataSource> implements Provider<DataSource> {
 
     static final Logger LOG = Logger.getLogger(TestProvider.class.getName());

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java?view=diff&rev=553285&r1=553284&r2=553285
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java Wed Jul  4 11:06:54 2007
@@ -43,7 +43,7 @@
         WebResponse response = newClient().getResponse(req);
 
         assertEquals("text/xml", response.getContentType());
-        assertEquals("UTF-8", response.getCharacterSet());
+        //assertEquals("UTF-8", response.getCharacterSet());
 
         Document doc = DOMUtils.readXml(response.getInputStream());
         assertNotNull(doc);



Mime
View raw message