cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r505443 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/configuration/spring/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/ rt/bindings/s...
Date Fri, 09 Feb 2007 19:36:04 GMT
Author: dandiep
Date: Fri Feb  9 11:36:02 2007
New Revision: 505443

URL: http://svn.apache.org/viewvc?view=rev&rev=505443
Log:
o Add Spring XML parser which create a JAX-WS Endpoint and a Server.
  The former is meant for the simple cases. The latter is for more
  advanced users who need to tweak things like the binding. Ultimately
  I would like to unify these, but I think I need to do another round
  of changes to unify the Provider/Dispatch/Normal JAX-WS server code
  first.
o Try setting the DefaultBus in the CXFBusImpl constructor so things
  work correctly from Spring.
o Add a SOAP Binding Spring XML parser.

These parsers are in no way complete. For instance, the SOAP binding
xml format still needs a property editor to support different SOAP
versions, but I wanted to get something in so those working on the
servlet support could keep working on it :-)

Added:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java   (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java   (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.handlers   (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.schemas   (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/org/
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/org/apache/
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/org/apache/cxf/
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/org/apache/cxf/binding/
    incubator/cxf/trunk/rt/bindings/soap/src/main/resources/org/apache/cxf/binding/soap/
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java
      - copied, changed from r504941, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBeanDefinitionParser.java
      - copied, changed from r504941, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBeanDefinitionParser.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml   (with props)
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml   (with props)
Removed:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBeanDefinitionParser.java
Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.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/spring/NamespaceHandler.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?view=diff&rev=505443&r1=505442&r2=505443
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java Fri Feb  9 11:36:02 2007
@@ -28,24 +28,61 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanDefinitionHolder;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
+import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
+import org.springframework.beans.factory.xml.ParserContext;
 import org.springframework.util.StringUtils;
 
 public abstract class AbstractBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
+
+    protected void setFirstChildAsProperty(Element element, ParserContext ctx, 
+                                         BeanDefinitionBuilder bean, String string) {
+        Element first = getFirstChild(element);
+        
+        if (first == null) {
+            throw new IllegalStateException(string + " property must have child elements!");
+        }
+        
+        // Seems odd that we have to do the registration, I wonder if there is a better way
+        String id;
+        BeanDefinition child;
+        if (first.getNamespaceURI().equals(BeanDefinitionParserDelegate.BEANS_NAMESPACE_URI)) {
+            BeanDefinitionHolder bdh = ctx.getDelegate().parseBeanDefinitionElement(first);
+            child = bdh.getBeanDefinition();
+            id = bdh.getBeanName();
+            
+        } else {
+            child = ctx.getDelegate().parseCustomElement(first, bean.getBeanDefinition());
+            id = child.toString();
+        }
+       
+        ctx.getRegistry().registerBeanDefinition(id, child);
+        bean.addPropertyReference(string, id);
+        
+    }
+
+    private Element getFirstChild(Element element) {
+        Element first = null;
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node n = children.item(i);
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                first = (Element) n;
+            }
+        }
+        return first;
+    }
     
-    protected void mapElementToJaxbProperty(Element parent, 
-                                            BeanDefinitionBuilder bean, 
-                                            QName name,
+    protected void mapElementToJaxbProperty(Element parent, BeanDefinitionBuilder bean, QName name,
                                             String string) {
         mapElementToJaxbProperty(parent, bean, name, string, null);
     }
-    
-    protected void mapElementToJaxbProperty(Element parent, 
-                                            BeanDefinitionBuilder bean, 
-                                            QName name,
-                                            String string,
-                                            Class<?> c) {
+
+    protected void mapElementToJaxbProperty(Element parent, BeanDefinitionBuilder bean, QName name,
+                                            String string, Class<?> c) {
         Node data = null;
         NodeList nl = parent.getChildNodes();
         for (int i = 0; i < nl.getLength(); i++) {
@@ -64,15 +101,14 @@
         JAXBContext context = null;
         Object obj = null;
         try {
-            context = JAXBContext.newInstance(getJaxbPackage(), 
-                                              getClass().getClassLoader());
+            context = JAXBContext.newInstance(getJaxbPackage(), getClass().getClassLoader());
             Unmarshaller u = context.createUnmarshaller();
             if (c != null) {
                 obj = u.unmarshal(data, c);
             } else {
                 obj = u.unmarshal(data);
             }
-            
+
             if (obj instanceof JAXBElement<?>) {
                 JAXBElement<?> el = (JAXBElement<?>)obj;
                 obj = el.getValue();
@@ -90,14 +126,25 @@
     protected String getJaxbPackage() {
         return "";
     }
-    
-    protected void mapAttributeToProperty(Element element, 
-                                          BeanDefinitionBuilder bean, 
-                                          String attrName,
+
+    protected void mapAttributeToProperty(Element element, BeanDefinitionBuilder bean, String attrName,
                                           String propertyName) {
-        String cls = element.getAttribute(attrName);
-        if (StringUtils.hasText(cls)) {
-            bean.addPropertyValue(propertyName, cls);
+        String val = element.getAttribute(attrName);
+        mapToProperty(bean, propertyName, val);
+    }
+
+    protected void mapToProperty(BeanDefinitionBuilder bean, String propertyName, String val) {
+        if (ID_ATTRIBUTE.equals(propertyName)) {
+            return;
+        }
+        
+        if (StringUtils.hasText(val)) {
+            if (val.startsWith("#")) {
+                bean.addPropertyReference(propertyName, val.substring(1));
+            } else {
+                bean.addPropertyValue(propertyName, val);
+            }
         }
     }
+
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java?view=diff&rev=505443&r1=505442&r2=505443
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoFactoryBean.java Fri Feb  9 11:36:02 2007
@@ -26,6 +26,7 @@
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
+import org.apache.cxf.message.Message;
 import org.apache.cxf.service.factory.AbstractBindingInfoFactoryBean;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingMessageInfo;
@@ -40,6 +41,7 @@
     private String style = "document";
     private String use;
     private String transportURI = "http://schemas.xmlsoap.org/soap/http";
+    private boolean mtomEnabled;
     
     @Override
     public BindingInfo create() {
@@ -50,6 +52,10 @@
         info.setStyle(getStyle());
         info.setTransportURI(getTransportURI());
         
+        if (mtomEnabled) {
+            info.setProperty(Message.MTOM_ENABLED, Boolean.TRUE);
+        }
+        
         for (OperationInfo op : si.getInterface().getOperations()) {
             SoapOperationInfo sop = new SoapOperationInfo();
             sop.setAction(getSoapAction(op));
@@ -160,6 +166,14 @@
 
     public void setStyle(String style) {
         this.style = style;
+    }
+
+    public boolean isMtomEnabled() {
+        return mtomEnabled;
+    }
+
+    public void setMtomEnabled(boolean mtomEnabled) {
+        this.mtomEnabled = mtomEnabled;
     }
     
 }

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java (added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java Fri Feb  9 11:36:02 2007
@@ -0,0 +1,27 @@
+/**
+ * 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.binding.soap.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+public class NamespaceHandler extends NamespaceHandlerSupport {
+    public void init() {
+        registerBeanDefinitionParser("soapBinding", new SoapBindingInfoFactoryBeanDefinitionParser());        
+    }
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java (added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java Fri Feb  9 11:36:02 2007
@@ -0,0 +1,47 @@
+/**
+ * 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.binding.soap.spring;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+import org.apache.cxf.binding.soap.SoapBindingInfoFactoryBean;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+
+public class SoapBindingInfoFactoryBeanDefinitionParser extends AbstractBeanDefinitionParser {
+
+    @Override
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        NamedNodeMap atts = element.getAttributes();
+        for (int i = 0; i < atts.getLength(); i++) {
+            Attr node = (Attr) atts.item(i);
+            
+            mapToProperty(bean, node.getLocalName(), node.getValue());
+        }
+    }
+
+    @Override
+    protected Class getBeanClass(Element arg0) {
+        return SoapBindingInfoFactoryBean.class;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/spring/SoapBindingInfoFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.handlers?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.handlers (added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.handlers Fri Feb  9 11:36:02 2007
@@ -0,0 +1 @@
+http\://cxf.apache.org/bindings/soap=org.apache.cxf.binding.soap.spring.NamespaceHandler
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.handlers
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.schemas?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.schemas (added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.schemas Fri Feb  9 11:36:02 2007
@@ -0,0 +1 @@
+http\://cxf.apache.org/schema/bindings/soap.xsd=org/apache/cxf/binding/soap/spring/soap.xsd
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/spring.schemas
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?view=diff&rev=505443&r1=505442&r2=505443
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Fri Feb  9 11:36:02 2007
@@ -49,6 +49,8 @@
         if (null != lifeCycleManager) {
             lifeCycleManager.initComplete();
         }
+        
+        CXFBusFactory.possiblySetDefaultBus(this);
     }
 
     protected void setState(BusState state) {

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=505443&r1=505442&r2=505443
==============================================================================
--- 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 Fri Feb  9 11:36:02 2007
@@ -67,6 +67,8 @@
     private AbstractJaxWsServiceFactoryBean serviceFactory;
 
     private String bindingURI;
+
+    private Map<String, Object> properties;
     
     public EndpointImpl(Bus b, Object implementor, AbstractJaxWsServiceFactoryBean serviceFactory) {
         this.bus = b;
@@ -140,8 +142,7 @@
 
     @Override
     public Map<String, Object> getProperties() {
-        // TODO Auto-generated method stub
-        return null;
+        return properties;
     }
 
     @Override
@@ -166,9 +167,12 @@
     }
 
     @Override
-    public void setProperties(Map<String, Object> arg0) {
-        // TODO Auto-generated method stub
-
+    public void setProperties(Map<String, Object> properties) {
+        this.properties = properties;
+        
+        if (server != null) {
+            server.getEndpoint().putAll(properties);
+        }
     }
 
     @Override
@@ -233,6 +237,10 @@
         }
         
         org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
+        
+        if (properties != null) {
+            endpoint.putAll(properties);
+        }
         
         configureObject(endpoint);
         

Copied: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java (from r504941, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBean.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java?view=diff&rev=505443&p1=incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBean.java&r1=504941&p2=incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java&r2=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java Fri Feb  9 11:36:02 2007
@@ -20,60 +20,144 @@
 package org.apache.cxf.jaxws.spring;
 
 import java.util.Map;
+import java.util.concurrent.Executor;
+
+import javax.xml.ws.Endpoint;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.jaxws.EndpointImpl;
-import org.springframework.beans.factory.InitializingBean;
+import org.apache.cxf.jaxws.support.AbstractJaxWsServiceFactoryBean;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
 
-public class EndpointBean implements InitializingBean {
-    private Object implementor;
-    private Class implementorClass;
-    private Map<String, Object> properties;
+/**
+ * Creates a JAX-WS Endpoint. Implements InitializingBean to make it easier for Spring
+ * users to use.
+ */
+public class EndpointFactoryBean implements FactoryBean, ApplicationContextAware {
     private String address;
     private Bus bus;
+    private Executor executor;
+    private AbstractJaxWsServiceFactoryBean serviceFactory;
+    private Object implementor;
+    private boolean publish = true;
+    private EndpointImpl endpoint;
+    private ApplicationContext context;
+    private String binding;
+    private Map<String, Object> properties;
     
-    public void afterPropertiesSet() throws Exception {
-        EndpointImpl ep = new EndpointImpl(bus, implementor);
-        Map<String, Object> props = ep.getProperties();
-        if (props != null) {
-            props.putAll(properties);
+    public void setApplicationContext(ApplicationContext c) 
+        throws BeansException {
+        this.context = c;
+    }
+
+    public Object getObject() throws Exception {
+        if (endpoint != null) {
+            return endpoint;
+        }
+        
+        // Construct Endpoint...
+        
+        if (bus == null) {
+            bus = (Bus) context.getBean("cxf");
+            
+            if (bus == null) {
+                bus = BusFactory.getDefaultBus();
+            }
+        }
+
+        if (serviceFactory == null) {
+            endpoint = new EndpointImpl(bus, implementor, binding);
         } else {
-            ep.setProperties(properties);
+            endpoint = new EndpointImpl(bus, implementor, serviceFactory);
         }
         
-        ep.publish(address);
+        if (executor != null) {
+            endpoint.setExecutor(executor);
+        }
+
+        if (properties != null) {
+            endpoint.setProperties(properties);
+        }
+        
+        if (publish) {
+            endpoint.publish(address);
+        }
+        return endpoint;
     }
-    
-    public Bus getBus() {
-        return bus;
+
+    public Class getObjectType() {
+        return Endpoint.class;
     }
-    public void setBus(Bus bus) {
-        this.bus = bus;
+
+    public boolean isSingleton() {
+        return true;
     }
+
+    public void setBinding(String binding) {
+        this.binding = binding;
+    }
+
     public String getAddress() {
         return address;
     }
+
     public void setAddress(String address) {
         this.address = address;
     }
+
+    public Bus getBus() {
+        return bus;
+    }
+
+    public void setBus(Bus bus) {
+        this.bus = bus;
+    }
+
+    public Executor getExecutor() {
+        return executor;
+    }
+
+    public void setExecutor(Executor executor) {
+        this.executor = executor;
+    }
+
     public Object getImplementor() {
         return implementor;
     }
+
     public void setImplementor(Object implementor) {
         this.implementor = implementor;
     }
-    public Class getImplementorClass() {
-        return implementorClass;
+
+    public boolean isPublish() {
+        return publish;
     }
-    public void setImplementorClass(Class implementorClass) {
-        this.implementorClass = implementorClass;
+
+    public void setPublish(boolean publish) {
+        this.publish = publish;
     }
+
+    public String getBinding() {
+        return binding;
+    }
+
     public Map<String, Object> getProperties() {
         return properties;
     }
+
     public void setProperties(Map<String, Object> properties) {
         this.properties = properties;
     }
-    
-    
+
+    public AbstractJaxWsServiceFactoryBean getServiceFactory() {
+        return serviceFactory;
+    }
+
+    public void setServiceFactory(AbstractJaxWsServiceFactoryBean serviceFactory) {
+        this.serviceFactory = serviceFactory;
+    }
 }

Copied: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBeanDefinitionParser.java (from r504941, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBeanDefinitionParser.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBeanDefinitionParser.java?view=diff&rev=505443&p1=incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBeanDefinitionParser.java&r1=504941&p2=incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBeanDefinitionParser.java&r2=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBeanDefinitionParser.java Fri Feb  9 11:36:02 2007
@@ -18,22 +18,71 @@
  */
 package org.apache.cxf.jaxws.spring;
 
+import java.util.Map;
+
+import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
-import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.springframework.beans.FatalBeanException;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.util.StringUtils;
+
+public class EndpointFactoryBeanDefinitionParser extends AbstractBeanDefinitionParser {
 
-public class EndpointBeanDefinitionParser extends AbstractBeanDefinitionParser {
+    private static final String IMPLEMENTOR = "implementor";
 
     @Override
-    protected void doParse(Element element, BeanDefinitionBuilder bean) {
-        mapAttributeToProperty(element, bean, "class", "serviceClass");
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        NamedNodeMap atts = element.getAttributes();
+        for (int i = 0; i < atts.getLength(); i++) {
+            Attr node = (Attr) atts.item(i);
+            String val = node.getValue();
+            
+            if (IMPLEMENTOR.equals(node.getLocalName())) {
+                loadImplementor(bean, val);
+            } else {
+                mapToProperty(bean, node.getLocalName(), val);
+            }
+        }
+        
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node n = children.item(i);
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                if ("properties".equals(n.getLocalName())) {
+                    Map map = ctx.getDelegate().parseMapElement((Element) n, bean.getBeanDefinition());
+                    bean.addPropertyValue("properties", map);
+                } else {
+                    setFirstChildAsProperty((Element) n, ctx, bean, n.getLocalName());
+                }
+            }
+        }
+    }
+
+    private void loadImplementor(BeanDefinitionBuilder bean, String val) {
+        if (StringUtils.hasText(val)) {
+            if (val.startsWith("#")) {
+                bean.addPropertyReference(IMPLEMENTOR, val.substring(1));
+            } else {
+                try {
+                    bean.addPropertyValue(IMPLEMENTOR,
+                                          ClassLoaderUtils.loadClass(val, getClass()).newInstance());
+                } catch (Exception e) {
+                    throw new FatalBeanException("Could not load class: " + val, e);
+                }
+            }
+        }
     }
 
     @Override
     protected Class getBeanClass(Element arg0) {
-        return JaxWsServerFactoryBean.class;
+        return EndpointFactoryBean.class;
     }
 
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java?view=diff&rev=505443&r1=505442&r2=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/NamespaceHandler.java Fri Feb  9 11:36:02 2007
@@ -22,6 +22,7 @@
 
 public class NamespaceHandler extends NamespaceHandlerSupport {
     public void init() {
-        registerBeanDefinitionParser("endpoint", new EndpointBeanDefinitionParser());        
+        registerBeanDefinitionParser("endpoint", new EndpointFactoryBeanDefinitionParser());        
+        registerBeanDefinitionParser("server", new ServerBeanDefinitionParser());        
     }
 }

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java Fri Feb  9 11:36:02 2007
@@ -0,0 +1,97 @@
+/**
+ * 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.jaxws.spring;
+
+import java.util.Map;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.util.StringUtils;
+
+public class ServerBeanDefinitionParser extends AbstractBeanDefinitionParser {
+
+    private static final String IMPLEMENTOR = "implementor";
+
+    @Override
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        NamedNodeMap atts = element.getAttributes();
+        for (int i = 0; i < atts.getLength(); i++) {
+            Attr node = (Attr) atts.item(i);
+            String val = node.getValue();
+            
+            if (IMPLEMENTOR.equals(node.getLocalName())) {
+                loadImplementor(bean, val);
+            } else {
+                mapToProperty(bean, node.getLocalName(), val);
+            }
+        }
+        
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node n = children.item(i);
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                if ("properties".equals(n.getLocalName())) {
+                    Map map = ctx.getDelegate().parseMapElement((Element) n, bean.getBeanDefinition());
+                    bean.addPropertyValue("properties", map);
+                } else if ("executor".equals(n.getLocalName())) {
+                    setFirstChildAsProperty((Element) n, ctx, bean, "serviceFactory.executor");
+                } else if ("invoker".equals(n.getLocalName())) {
+                    setFirstChildAsProperty((Element) n, ctx, bean, "serviceFactory.invoker");
+                } else if ("binding".equals(n.getLocalName())) {
+                    setFirstChildAsProperty((Element) n, ctx, bean, "bindingFactory");
+                } else {
+                    setFirstChildAsProperty((Element) n, ctx, bean, n.getLocalName());
+                }
+            }
+        }
+        
+        bean.setInitMethodName("create");
+    }
+
+    private void loadImplementor(BeanDefinitionBuilder bean, String val) {
+        if (StringUtils.hasText(val)) {
+            if (val.startsWith("#")) {
+                bean.addPropertyReference(IMPLEMENTOR, val.substring(1));
+            } else {
+                try {
+                    bean.addPropertyValue(IMPLEMENTOR,
+                                          ClassLoaderUtils.loadClass(val, getClass()).newInstance());
+                } catch (Exception e) {
+                    throw new FatalBeanException("Could not load class: " + val, e);
+                }
+            }
+        }
+    }
+
+    @Override
+    protected Class getBeanClass(Element arg0) {
+        return JaxWsServerFactoryBean.class;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ServerBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd?view=diff&rev=505443&r1=505442&r2=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/org/apache/cxf/jaxws/spring/jaxws.xsd Fri Feb  9 11:36:02 2007
@@ -14,10 +14,46 @@
     <xsd:complexType>
       <xsd:complexContent>
         <xsd:extension base="beans:identifiedType">
-          <xsd:attribute name="class" type="xsd:string" />
+          <xsd:sequence>
+            <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="implementor" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="properties" type="beans:mapType" minOccurs="0"/>
+            <xsd:element name="serviceFactory" type="xsd:anyType" minOccurs="0"/>
+          </xsd:sequence>
+          <xsd:attribute name="address" type="xsd:string" />
+          <xsd:attribute name="binding" type="xsd:string" />
+          <xsd:attribute name="bus" type="xsd:string" />
+          <xsd:attribute name="implementor" type="xsd:string"/>
+          <xsd:attribute name="publish" type="xsd:boolean" default="true"/>
+          <xsd:attribute name="portName" type="xsd:QName" />
+          <xsd:attribute name="serviceName" type="xsd:QName" />
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  
+  <xsd:element name="server">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="beans:identifiedType">
+          <xsd:sequence>
+            <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="implementor" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="invoker" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="properties" type="beans:mapType" minOccurs="0"/>
+            <xsd:element name="serviceBean" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="serviceFactory" type="xsd:anyType" minOccurs="0"/>
+          </xsd:sequence>
+          <xsd:attribute name="address" type="xsd:string" />
+          <xsd:attribute name="bus" type="xsd:string" />
+          <xsd:attribute name="serviceClass" type="xsd:string"/>
+          <xsd:attribute name="serviceBean" type="xsd:string"/>
+          <xsd:attribute name="start" type="xsd:boolean" default="true"/>
+          <xsd:attribute name="transportId" type="xsd:string"/>
         </xsd:extension>
       </xsd:complexContent>
     </xsd:complexType>
   </xsd:element>
 
-</xsd:schema>
\ No newline at end of file
+</xsd:schema>

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java Fri Feb  9 11:36:02 2007
@@ -0,0 +1,80 @@
+/**
+ * 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.jaxws.spring;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.binding.soap.SoapBindingInfoFactoryBean;
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.jaxws.service.Hello;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringBeansTest extends TestCase {
+    public void xtestEndpoints() throws Exception {
+        ClassPathXmlApplicationContext ctx = 
+            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/endpoints.xml"});
+
+        Object bean = ctx.getBean("simple");
+        assertNotNull(bean);
+        
+        EndpointImpl ep = (EndpointImpl) bean;
+        assertNotNull(ep.getImplementor());
+        assertNotNull(ep.getServer());
+        
+        bean = ctx.getBean("simpleWithAddress");
+        assertNotNull(bean);
+        
+        ep = (EndpointImpl) bean;
+        assertNotNull(ep.getImplementor());
+        assertEquals("http://localhost:8080/simpleWithAddress", 
+                     ep.getServer().getEndpoint().getEndpointInfo().getAddress());
+        
+        bean = ctx.getBean("inlineImplementor");
+        assertNotNull(bean);
+        
+        ep = (EndpointImpl) bean;
+        assertNotNull(ep.getImplementor());
+        assertNotNull(ep.getServer());
+        
+        bean = ctx.getBean("epWithProps");
+        assertNotNull(bean);
+        
+        ep = (EndpointImpl) bean;
+        assertEquals("bar", ep.getProperties().get("foo"));
+        
+        bean = ctx.getBean("classImpl");
+        assertNotNull(bean);
+        
+        ep = (EndpointImpl) bean;
+        assertTrue(ep.getImplementor() instanceof Hello);
+    }
+    
+    public void testServers() throws Exception {
+        ClassPathXmlApplicationContext ctx = 
+            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/servers.xml"});
+
+        JaxWsServerFactoryBean bean = (JaxWsServerFactoryBean) ctx.getBean("simple");
+        assertNotNull(bean);
+
+        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineSoapBinding");
+        assertNotNull(bean);
+        assertTrue(((SoapBindingInfoFactoryBean) bean.getBindingFactory()).isMtomEnabled());
+    }
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml Fri Feb  9 11:36:02 2007
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:jaxws="http://cxf.apache.org/jaxws"
+      xmlns:soap="http://cxf.apache.org/bindings/soap"
+      xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schema/bindings/soap.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
+
+  <import resource="classpath:META-INF/cxf/cxf.xml"/>
+  <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
+    
+  <bean class="org.apache.cxf.transport.local.LocalTransportFactory" lazy-init="false">
+      <property name="transportIds">
+          <list>
+              <value>http://cxf.apache.org/transports/local</value>
+              <value>http://schemas.xmlsoap.org/soap/http</value>
+              <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+          </list>
+      </property>
+  </bean>
+  
+  <jaxws:endpoint id="simple" implementor="#greeter"/>
+
+  <bean id="greeter" class="org.apache.hello_world_soap_http.GreeterImpl"/>
+
+  <jaxws:endpoint id="simpleWithAddress" 
+    implementor="#greeter" address="http://localhost:8080/simpleWithAddress"/>
+  
+  <jaxws:endpoint id="inlineImplementor" address="http://localhost:8080/simpleWithAddress">
+    <jaxws:implementor>
+      <bean class="org.apache.hello_world_soap_http.GreeterImpl"/>
+    </jaxws:implementor>
+  </jaxws:endpoint>
+  
+  <jaxws:endpoint id="epWithProps" 
+    implementor="#greeter"
+    address="http://localhost:8080/test">
+    <jaxws:properties>
+      <entry key="foo" value="bar"/>
+    </jaxws:properties>
+  </jaxws:endpoint>
+  
+  <jaxws:endpoint id="classImpl" 
+    implementor="org.apache.cxf.jaxws.service.Hello"
+    address="http://localhost:8080/test"/>
+</beans>

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml?view=auto&rev=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml Fri Feb  9 11:36:02 2007
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:jaxws="http://cxf.apache.org/jaxws"
+      xmlns:soap="http://cxf.apache.org/bindings/soap"
+      xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schema/bindings/soap.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
+
+  <import resource="classpath:META-INF/cxf/cxf.xml"/>
+  <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
+    
+  <bean class="org.apache.cxf.transport.local.LocalTransportFactory" lazy-init="false">
+      <property name="transportIds">
+          <list>
+              <value>http://cxf.apache.org/transports/local</value>
+              <value>http://schemas.xmlsoap.org/soap/http</value>
+              <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+          </list>
+      </property>
+  </bean>
+  
+  <jaxws:server id="simple" serviceBean="#greeter"/>
+
+  <bean id="greeter" class="org.apache.hello_world_soap_http.GreeterImpl"/>
+
+  <jaxws:server id="simpleWithAddress" 
+    serviceBean="#greeter" address="http://localhost:8080/simpleWithAddress"/>
+  
+  <jaxws:server id="inlineImplementor" address="http://localhost:8080/simpleWithAddress">
+    <jaxws:serviceBean>
+      <bean class="org.apache.hello_world_soap_http.GreeterImpl"/>
+    </jaxws:serviceBean>
+  </jaxws:server>
+  
+  <jaxws:server id="inlineInvoker" 
+    serviceClass="org.apache.hello_world_soap_http.GreeterImpl"
+    address="http://localhost:8080/simpleWithAddress">
+    <jaxws:invoker>
+      <bean class="org.apache.cxf.service.invoker.BeanInvoker">
+        <constructor-arg>
+          <bean class="org.apache.hello_world_soap_http.GreeterImpl"/>
+        </constructor-arg>
+      </bean>
+    </jaxws:invoker>
+    
+  </jaxws:server>
+  
+  <jaxws:server id="inlineSoapBinding" 
+    serviceClass="org.apache.cxf.jaxws.service.Hello"
+    address="http://localhost:8080/test">
+    <jaxws:binding>
+      <soap:soapBinding mtomEnabled="true"/>
+    </jaxws:binding>
+  </jaxws:server>
+</beans>

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java?view=diff&rev=505443&r1=505442&r2=505443
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java Fri Feb  9 11:36:02 2007
@@ -53,7 +53,9 @@
         Service service = serviceFactory.getService();
         
         if (service == null) {
-            serviceFactory.setServiceClass(getServiceClass());
+            Class cls = getServiceClass();
+
+            serviceFactory.setServiceClass(cls);
             serviceFactory.setBus(getBus());
             service = serviceFactory.create();
         }



Mime
View raw message