Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 716EF45FC for ; Wed, 8 Jun 2011 15:24:55 +0000 (UTC) Received: (qmail 66624 invoked by uid 500); 8 Jun 2011 15:24:55 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 66572 invoked by uid 500); 8 Jun 2011 15:24:55 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 66565 invoked by uid 99); 8 Jun 2011 15:24:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 15:24:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 15:24:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BCC5E2388A64; Wed, 8 Jun 2011 15:24:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110608152433.BCC5E2388A64@eris.apache.org> 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 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 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 Bus. @@ -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 schemas = svc.getServiceInfos().get(0).getSchemas();