cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r511109 - in /incubator/cxf/trunk: ./ api/src/main/java/org/apache/cxf/databinding/ api/src/main/java/org/apache/cxf/service/model/ api/src/main/java/org/apache/cxf/wsdl/ api/src/test/java/org/apache/cxf/service/model/ parent/ rt/bindings/x...
Date Fri, 23 Feb 2007 21:29:16 GMT
Author: dandiep
Date: Fri Feb 23 13:29:15 2007
New Revision: 511109

URL: http://svn.apache.org/viewvc?view=rev&rev=511109
Log:
o Upgrade to JAXB 2.1
o Make the ClientProxyFactoryBean easier to use. Add some simple username/password,
  and convenience settters for the ClientFactoryBean.
o Change the Databinding interface so it takes a Service, not a ServiceInfo 
  (needed for the Aegis binding from XFire)
o Remove some unneeded methods from EndpointReferenceUtils.
o Fix ReflectionServiceFactory so we don't initialize the Databinding twice.
o Rework the ContextPropertiesMappingTest to not use EasyMock as it was failing.


Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
    incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java
    incubator/cxf/trunk/parent/pom.xml
    incubator/cxf/trunk/pom.xml
    incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ContextPropertiesMappingTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBinding.java Fri
Feb 23 13:29:15 2007
@@ -19,7 +19,7 @@
 
 package org.apache.cxf.databinding;
 
-import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.service.Service;
 
 public interface DataBinding {
     
@@ -36,6 +36,6 @@
      * information from the databinding.
      * @param serviceInfo
      */
-    void initialize(ServiceInfo serviceInfo);
+    void initialize(Service service);
 
 }

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
Fri Feb 23 13:29:15 2007
@@ -38,7 +38,6 @@
     
     Map<QName, OperationInfo> operations = new ConcurrentHashMap<QName, OperationInfo>(4);
     
-    
     public InterfaceInfo(ServiceInfo info, QName q) {
         name = q;
         service = info;

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
Fri Feb 23 13:29:15 2007
@@ -26,7 +26,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import javax.jws.WebService;
 import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.wsdl.Service;
@@ -572,32 +571,6 @@
         EndpointReferenceType reference = new EndpointReferenceType();
         setAddress(reference, ANONYMOUS_ADDRESS);
         return reference;
-    }
-
-
-    /**
-     * Get the WebService for the provided class.  If the class
-     * itself does not have a WebService annotation, this method
-     * is called recursively on the class's interfaces and superclass. 
-     * @param cls - the Class .
-     * @return WebService - the web service
-     */
-    public static WebService getWebServiceAnnotation(Class<?> cls) {
-        if (cls == null) {
-            return null;
-        }
-        WebService ws = cls.getAnnotation(WebService.class); 
-        if (null != ws) {
-            return ws;
-        }
-        for (Class<?> inf : cls.getInterfaces()) {
-            ws = getWebServiceAnnotation(inf);
-            if (null != ws) {
-                return ws;
-            }
-        }
-
-        return getWebServiceAnnotation(cls.getSuperclass());
     }
 
     /**

Modified: incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java
(original)
+++ incubator/cxf/trunk/api/src/test/java/org/apache/cxf/service/model/MessagePartInfoTest.java
Fri Feb 23 13:29:15 2007
@@ -31,8 +31,11 @@
         
     public void setUp() throws Exception {
         
+        MessageInfo msg = new MessageInfo(null, 
+                                          new QName("http://apache.org/hello_world_soap_http/types",
+                                                    "testMessage"));
         messagePartInfo = new MessagePartInfo(new QName(
-            "http://apache.org/hello_world_soap_http", "testMessagePart"), null);
+            "http://apache.org/hello_world_soap_http", "testMessagePart"), msg);
         messagePartInfo.setElement(true);
     }
     

Modified: incubator/cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/parent/pom.xml?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/parent/pom.xml (original)
+++ incubator/cxf/trunk/parent/pom.xml Fri Feb 23 13:29:15 2007
@@ -44,8 +44,8 @@
 
 
         <jsr181.version>1.0-MR1</jsr181.version>
-        <jaxb.version>2.0</jaxb.version>
-        <jaxb.impl.version>2.0.3</jaxb.impl.version>
+        <jaxb.version>2.1</jaxb.version>
+        <jaxb.impl.version>2.1.2</jaxb.impl.version>
         <jaxws.version>2.0</jaxws.version>
         <jetty.version>5.1.11</jetty.version>
         <saaj.version>1.3</saaj.version>
@@ -505,6 +505,10 @@
                     <exclusion>
                         <groupId>javax.xml.bind</groupId>
                         <artifactId>jsr173_api</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>javax.xml.bind</groupId>
+                        <artifactId>jaxb-api</artifactId>
                     </exclusion>
                 </exclusions>
             </dependency>

Modified: incubator/cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/pom.xml (original)
+++ incubator/cxf/trunk/pom.xml Fri Feb 23 13:29:15 2007
@@ -45,7 +45,7 @@
         <snapshotRepository>
             <id>apache.snapshots</id>
             <name>Apache SNAPSHOT Repository</name>
-            <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+            <url>scpexe://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
         </snapshotRepository>
         <repository>
             <id>apache.incubating</id>

Modified: incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
(original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
Fri Feb 23 13:29:15 2007
@@ -138,7 +138,7 @@
 
         control.reset();
         JAXBDataBinding db = new JAXBDataBinding();
-        db.initialize(serviceInfo);
+        db.initialize(service);
         db.setContext(JAXBContext.newInstance(jaxbClasses));
         service.setDataBinding(db);
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
Fri Feb 23 13:29:15 2007
@@ -27,7 +27,7 @@
 import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
-import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.service.Service;
 
 /**
  * A simple databinding implementation which reads and writes Source objects.
@@ -48,7 +48,7 @@
         this.nodeWriter = new NodeDataWriter();
     }
 
-    public void initialize(ServiceInfo serviceInfo) {
+    public void initialize(Service service) {
         // do nothing
     }
     

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
Fri Feb 23 13:29:15 2007
@@ -41,7 +41,7 @@
     }
     
     protected void initializeDataBindings() {
-        dataBinding.initialize(getService().getServiceInfo());
+        dataBinding.initialize(getService());
         
         service.setDataBinding(dataBinding);
     }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Fri Feb 23 13:29:15 2007
@@ -51,6 +51,9 @@
 
 import org.xml.sax.SAXException;
 
+import com.sun.xml.bind.v2.ContextFactory;
+import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
+
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.i18n.UncheckedException;
@@ -66,6 +69,7 @@
 import org.apache.cxf.jaxb.io.XMLStreamDataReader;
 import org.apache.cxf.jaxb.io.XMLStreamDataWriter;
 import org.apache.cxf.resource.URIResolver;
+import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
@@ -208,7 +212,8 @@
         }
     }
 
-    public void initialize(ServiceInfo serviceInfo) {
+    public void initialize(Service service) {
+        ServiceInfo serviceInfo = service.getServiceInfo();
         Set<Class<?>> classes = new HashSet<Class<?>>();
         JAXBContextInitializer initializer = 
             new JAXBContextInitializer(serviceInfo, classes);
@@ -265,7 +270,20 @@
         }
 
         serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST, col);
-        JAXBSchemaInitializer schemaInit = new JAXBSchemaInitializer(serviceInfo, col);
+        JAXBContextImpl riContext;
+        if (context instanceof JAXBContextImpl) {
+            riContext = (JAXBContextImpl) context;
+        } else {
+            // fall back if we're using another jaxb implementation
+            try {
+                riContext = (JAXBContextImpl)
+                    ContextFactory.createContext(classes.toArray(new Class[classes.size()]),
null);
+            } catch (JAXBException e) {
+                throw new ServiceConstructionException(e);
+            }
+        }
+        
+        JAXBSchemaInitializer schemaInit = new JAXBSchemaInitializer(serviceInfo, col, riContext);
         schemaInit.walk();
 
     }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Fri Feb 23 13:29:15 2007
@@ -19,14 +19,12 @@
 
 package org.apache.cxf.jaxb;
 
-import java.lang.reflect.Type;
+import java.util.Iterator;
 
 import javax.xml.namespace.QName;
 
-import com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader;
-import com.sun.xml.bind.v2.model.core.Element;
-import com.sun.xml.bind.v2.model.core.NonElement;
-import com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder;
+import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
+import com.sun.xml.bind.v2.runtime.JaxBeanInfo;
 
 import org.apache.cxf.service.ServiceModelVisitor;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -39,10 +37,12 @@
 class JAXBSchemaInitializer extends ServiceModelVisitor {
 
     private XmlSchemaCollection schemas;
-
-    public JAXBSchemaInitializer(ServiceInfo serviceInfo, XmlSchemaCollection col) {
+    private JAXBContextImpl context;
+    
+    public JAXBSchemaInitializer(ServiceInfo serviceInfo, XmlSchemaCollection col, JAXBContextImpl
context) {
         super(serviceInfo);
         schemas = col;
+        this.context = context;
     }
 
     @Override
@@ -56,27 +56,24 @@
         if (clazz == null) {
             return;
         }
-        
-        RuntimeModelBuilder builder = new RuntimeModelBuilder(new RuntimeInlineAnnotationReader(),
null);
-        NonElement<Type, Class> typeInfo = builder.getTypeInfo(clazz, null);
-
-        QName typeName = typeInfo.getTypeName();
-        // TODO: this doesn't seem to work with elements yet
-        if (typeName == null) {
-            return;
-        }
 
-        boolean isElement = typeInfo instanceof Element;
-        if (isElement) {
-            isElement = ((Element) typeInfo).getElementName() != null;
-        }
+        JaxBeanInfo<?> beanInfo = context.getBeanInfo(clazz);
 
+        boolean isElement = beanInfo.isElement();
         part.setElement(isElement);
         if (isElement) {
-            QName name = ((Element) typeInfo).getElementName();
+            QName name = new QName(beanInfo.getElementNamespaceURI(null), 
+                                   beanInfo.getElementLocalName(null));
             part.setElementQName(name);
             part.setXmlSchema(schemas.getElementByQName(name));
         } else {
+            Iterator<QName> itr = beanInfo.getTypeNames().iterator();
+            if (!itr.hasNext()) {
+                return;
+            }
+            
+            QName typeName = itr.next();
+
             part.setTypeQName(typeName);
             part.setXmlSchema(schemas.getTypeByQName(typeName));
         }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ContextPropertiesMappingTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ContextPropertiesMappingTest.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ContextPropertiesMappingTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/ContextPropertiesMappingTest.java
Fri Feb 23 13:29:15 2007
@@ -25,6 +25,7 @@
 
 import javax.activation.DataHandler;
 import javax.activation.DataSource;
+import javax.mail.util.ByteArrayDataSource;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.handler.MessageContext;
 
@@ -142,7 +143,8 @@
         
         Collection<Attachment> attachments = new LinkedList<Attachment>();
 
-        DataSource source = EasyMock.createNiceMock(DataSource.class);
+        DataSource source = new ByteArrayDataSource(new byte[0], "text/xml");
+        
         DataHandler handler1 = new DataHandler(source);
         attachments.add(new AttachmentImpl("part1", handler1));
         DataHandler handler2 = new DataHandler(source);

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Fri Feb 23 13:29:15 2007
@@ -19,18 +19,57 @@
 package org.apache.cxf.frontend;
 
 import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.configuration.security.AuthorizationPolicy;
 import org.apache.cxf.endpoint.Client;
 
+/**
+ * This class will create a client for you which implements the specified
+ * service class. Example:
+ * <pre>
+ * ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
+ * factory.setServiceClass(YourServiceInterface.class);
+ * YourServiceInterface client = (YourServiceInterface) factory.create();
+ * </pre>
+ * To access the underlying Client object:
+ * <pre>
+ * Client cxfClient = ClientProxy.getClient(client);
+ * </pre>
+ */
 public class ClientProxyFactoryBean {
     private ClientFactoryBean clientFactoryBean;
-
+    private String username;
+    private String password;
+    private Map<String, Object> properties;
+    private Bus bus;
+    
     public ClientProxyFactoryBean() {
         super();
         this.clientFactoryBean = new ClientFactoryBean();
     }
 
     public Object create() {
+        if (properties == null) {
+            properties = new HashMap<String, Object>();
+        }
+        
+        if (username != null) {
+            AuthorizationPolicy authPolicy = new AuthorizationPolicy();
+            authPolicy.setUserName(username);
+            authPolicy.setPassword(password);
+            properties.put(AuthorizationPolicy.class.getName(), authPolicy);
+        }
+        
+        clientFactoryBean.setProperties(properties);
+        
+        if (bus != null) {
+            clientFactoryBean.setBus(bus);
+        }
+
         Client c = clientFactoryBean.create();
 
         ClientProxy handler = new ClientProxy(c);
@@ -48,6 +87,52 @@
     public void setClientFactoryBean(ClientFactoryBean clientFactoryBean) {
         this.clientFactoryBean = clientFactoryBean;
     }
-    
-    
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public Class getServiceClass() {
+        return clientFactoryBean.getServiceClass();
+    }
+
+    public void setServiceClass(Class serviceClass) {
+        clientFactoryBean.setServiceClass(serviceClass);
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public URL getWsdlURL() {
+        return clientFactoryBean.getServiceFactory().getWsdlURL();
+    }
+
+    public void setWsdlURL(URL wsdlURL) {
+        clientFactoryBean.getServiceFactory().setWsdlURL(wsdlURL);
+    }
+
+    public Bus getBus() {
+        return bus;
+    }
+
+    public void setBus(Bus bus) {
+        this.bus = bus;
+    }
+
+    public Map<String, Object> getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Map<String, Object> properties) {
+        this.properties = properties;
+    }
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/SimpleMethodDispatcher.java
Fri Feb 23 13:29:15 2007
@@ -91,4 +91,8 @@
     public Method getMethod(BindingOperationInfo op) {
         return opToMethod.get(op.getOperationInfo());
     }
+    
+    public Method getPrimaryMethod(OperationInfo op) {
+        return opToMethod.get(op);
+    }
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java
Fri Feb 23 13:29:15 2007
@@ -34,7 +34,23 @@
 
     @Override
     public QName getOperationName(InterfaceInfo service, Method method) {
-        return new QName(service.getName().getNamespaceURI(), method.getName());
+        String ns = service.getName().getNamespaceURI();
+        String local = method.getName();
+
+        QName name = new QName(ns, local);
+        if (service.getOperation(name) == null) {
+            return name;
+        }
+
+        int i = 1;
+        while (true) {
+            name = new QName(ns, local + i);
+            if (service.getOperation(name) == null) {
+                return name;
+            } else {
+                i++;
+            }
+        }
     }
 
     @Override

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Fri Feb 23 13:29:15 2007
@@ -125,8 +125,6 @@
 
         initializeServiceModel();
 
-        initializeDataBindings();
-        
         initializeDefaultInterceptors();
 
         if (invoker != null) {
@@ -140,7 +138,10 @@
         } else {
             getService().setExecutor(SynchronousExecutor.getInstance());
         }
-
+        if (getDataBinding() != null) {
+            getService().setDataBinding(getDataBinding());
+        }   
+        
         getService().put(MethodDispatcher.class.getName(), getMethodDispatcher());
 
         createEndpoints();
@@ -181,7 +182,7 @@
         initializeWSDLOperations();
 
         if (getDataBinding() != null) {
-            getDataBinding().initialize(getService().getServiceInfo());
+            getDataBinding().initialize(getService());
         }        
     }
     
@@ -190,19 +191,19 @@
         ServiceInfo serviceInfo = new ServiceInfo();
         ServiceImpl service = new ServiceImpl(serviceInfo);
         
+        service.put(MethodDispatcher.class.getName(), methodDispatcher);
+        
         serviceInfo.setName(getServiceQName());
         serviceInfo.setTargetNamespace(serviceInfo.getName().getNamespaceURI());
         
         createInterface(serviceInfo);
 
+        getDataBinding().initialize(service);
+        
         if (isWrapped()) {
             initializeWrappedElementNames(serviceInfo);
         }
         
-        if (getDataBinding() != null) {
-            getDataBinding().initialize(serviceInfo);
-        }
-        
         if (isWrapped()) {
             initializeWrappedSchema(serviceInfo);
         }
@@ -399,6 +400,7 @@
             el.setQName(mpi.getName());
             el.setMinOccurs(1);
             el.setMaxOccurs(1);
+            el.setNillable(true);
             
             if (mpi.isElement()) {
                 el.setRefName(mpi.getElementQName());

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?view=diff&rev=511109&r1=511108&r2=511109
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Fri Feb 23 13:29:15 2007
@@ -78,6 +78,7 @@
                                                "SoapPort2");
 
     public static Test suite() throws Exception {
+        System.setProperty("streax-xo.output.directory", "target/tmp-jaxb");
         TestSuite suite = new TestSuite(ClientServerTest.class);
         return new ClientServerSetupBase(suite) {
                 public void startServers() throws Exception {                    



Mime
View raw message