cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1133425 - in /cxf/trunk: rt/core/src/main/java/org/apache/cxf/endpoint/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cx...
Date Wed, 08 Jun 2011 15:24:33 GMT
Author: dkulp
Date: Wed Jun  8 15:24:32 2011
New Revision: 1133425

URL: http://svn.apache.org/viewvc?rev=1133425&view=rev
Log:
[CXF-3580] Allow element refs when checking for unwrapping from Dynamic client

Removed:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/FaultSerialVersionUID.java
Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=1133425&r1=1133424&r2=1133425&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Wed Jun  8 15:24:32
2011
@@ -118,11 +118,13 @@ public class ClientImpl
     }
 
     public ClientImpl(URL wsdlUrl) {
-        this(BusFactory.getThreadDefaultBus(), wsdlUrl, null, null, SimpleEndpointImplFactory.getSingleton());
+        this(BusFactory.getThreadDefaultBus(), wsdlUrl, (QName)null, 
+             null, SimpleEndpointImplFactory.getSingleton());
     }
 
     public ClientImpl(URL wsdlUrl, QName port) {
-        this(BusFactory.getThreadDefaultBus(), wsdlUrl, null, port, SimpleEndpointImplFactory.getSingleton());
+        this(BusFactory.getThreadDefaultBus(), wsdlUrl, (QName)null, 
+             port, SimpleEndpointImplFactory.getSingleton());
     }
 
     /**
@@ -152,7 +154,31 @@ public class ClientImpl
         WSDLServiceFactory sf = (service == null)
             ? (new WSDLServiceFactory(bus, wsdlUrl)) : (new WSDLServiceFactory(bus, wsdlUrl,
service));
         Service svc = sf.create();
+        EndpointInfo epfo = findEndpoint(svc, port);
 
+        try {
+            if (endpointImplFactory != null) {
+                getConduitSelector().setEndpoint(endpointImplFactory.newEndpointImpl(bus,
svc, epfo));
+            } else {
+                getConduitSelector().setEndpoint(new EndpointImpl(bus, svc, epfo));
+            }
+        } catch (EndpointException epex) {
+            throw new IllegalStateException("Unable to create endpoint: " + epex.getMessage(),
epex);
+        }
+        notifyLifecycleManager();        
+    }
+    /**
+     * Create a Client that uses a specific EndpointImpl.
+     * @param bus
+     * @param wsdlUrl
+     * @param service
+     * @param port
+     * @param endpointImplFactory
+     */
+    public ClientImpl(Bus bus, URL wsdlUrl, Service svc, QName port,
+                      EndpointImplFactory endpointImplFactory) {
+        this.bus = bus;
+        outFaultObserver = new ClientOutFaultObserver(bus);
         EndpointInfo epfo = findEndpoint(svc, port);
 
         try {

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java?rev=1133425&r1=1133424&r2=1133425&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java Wed Jun
 8 15:24:32 2011
@@ -47,6 +47,7 @@ public class WSDLServiceFactory extends 
     private QName serviceName;
     private QName endpointName;
     private Definition definition;
+    private boolean allowRefs;
 
     public WSDLServiceFactory(Bus b, Definition d) {
         setBus(b);
@@ -95,6 +96,11 @@ public class WSDLServiceFactory extends 
 
         serviceName = sn;
     }
+    
+    public void setAllowElementRefs(boolean b) {
+        allowRefs = b;
+    }
+
     public void setEndpointName(QName qn) {
         endpointName = qn;
     }
@@ -108,7 +114,9 @@ public class WSDLServiceFactory extends 
         List<ServiceInfo> services;
         if (serviceName == null) {
             try {
-                services = new WSDLServiceBuilder(getBus()).buildServices(definition);
+                WSDLServiceBuilder builder = new WSDLServiceBuilder(getBus());
+                builder.setAllowElementRefs(allowRefs);
+                services = builder.buildServices(definition);
             } catch (XmlSchemaException ex) {
                 throw new ServiceConstructionException(new Message("SERVICE_CREATION_MSG",
LOG), ex);
             }

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1133425&r1=1133424&r2=1133425&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Wed Jun  8 15:24:32 2011
@@ -76,6 +76,7 @@ import org.apache.cxf.service.factory.Se
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.wsdl11.WSDLServiceFactory;
 /**
  * This class reads a WSDL and creates a dynamic client from it.
  * 
@@ -98,6 +99,7 @@ public class DynamicClientFactory {
     private String tmpdir = System.getProperty("java.io.tmpdir");
 
     private boolean simpleBindingEnabled = true;
+    private boolean allowRefs;
     
     private Map<String, Object> jaxbContextProperties;
     
@@ -112,6 +114,10 @@ public class DynamicClientFactory {
     public void setTemporaryDirectory(String dir) {
         tmpdir = dir;
     }
+    
+    public void setAllowElementReferences(boolean b) {
+        allowRefs = b;
+    }
 
     /**
      * Create a new instance using a specific <tt>Bus</tt>.
@@ -252,10 +258,15 @@ public class DynamicClientFactory {
         }
         URL u = composeUrl(wsdlUrl);
         LOG.log(Level.FINE, "Creating client from URL " + u.toString());
-        ClientImpl client = new ClientImpl(bus, u, service, port,
+
+        WSDLServiceFactory sf = (service == null)
+            ? (new WSDLServiceFactory(bus, wsdlUrl)) : (new WSDLServiceFactory(bus, wsdlUrl,
service));
+        sf.setAllowElementRefs(allowRefs);
+        Service svc = sf.create();
+
+        ClientImpl client = new ClientImpl(bus, u, svc, port,
                                            getEndpointImplFactory());
 
-        Service svc = client.getEndpoint().getService();
         //all SI's should have the same schemas
         Collection<SchemaInfo> schemas = svc.getServiceInfos().get(0).getSchemas();
 



Mime
View raw message