Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 87018 invoked from network); 21 Aug 2008 16:40:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2008 16:40:59 -0000 Received: (qmail 84336 invoked by uid 500); 21 Aug 2008 16:40:57 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 84292 invoked by uid 500); 21 Aug 2008 16:40:57 -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 84283 invoked by uid 99); 21 Aug 2008 16:40:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Aug 2008 09:40:57 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Thu, 21 Aug 2008 16:40:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0BFAA23889C4; Thu, 21 Aug 2008 09:40:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r687800 - in /cxf/branches/2.1.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/classloader/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/jaxws/... Date: Thu, 21 Aug 2008 16:40:07 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080821164008.0BFAA23889C4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Aug 21 09:40:06 2008 New Revision: 687800 URL: http://svn.apache.org/viewvc?rev=687800&view=rev Log: Merged revisions 687798 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r687798 | dkulp | 2008-08-21 12:36:22 -0400 (Thu, 21 Aug 2008) | 2 lines [CXF-1735] Allow wrapper parts to be individually qualified in code first cases ........ Modified: cxf/branches/2.1.x-fixes/ (props changed) cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/ArrayService.java cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Aug 21 09:40:06 2008 @@ -1 +1 @@ -/cxf/trunk:686333-686363,686764,686820,687096,687363,687387,687463,687543,687722 +/cxf/trunk:686333-686363,686764,686820,687096,687363,687387,687463,687543,687722,687798 Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Aug 21 09:40:06 2008 @@ -1 +1 @@ -/cxf/trunk:1-686342,686344-686363,686764,686820,687096,687363,687387,687463,687543,687722 +/cxf/trunk:1-686342,686344-686363,686764,686820,687096,687363,687387,687463,687543,687722,687798 Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java?rev=687800&r1=687799&r2=687800&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java (original) +++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/common/classloader/ClassLoaderUtils.java Thu Aug 21 09:40:06 2008 @@ -120,12 +120,11 @@ if (cl != null) { return cl.loadClass(className); - } - - return loadClass2(className, callingClass); + } } catch (ClassNotFoundException e) { - return loadClass2(className, callingClass); + //ignore } + return loadClass2(className, callingClass); } private static Class loadClass2(String className, Class callingClass) @@ -134,10 +133,15 @@ return Class.forName(className); } catch (ClassNotFoundException ex) { try { - return ClassLoaderUtils.class.getClassLoader().loadClass(className); + if (ClassLoaderUtils.class.getClassLoader() != null) { + return ClassLoaderUtils.class.getClassLoader().loadClass(className); + } } catch (ClassNotFoundException exc) { - return callingClass.getClassLoader().loadClass(className); + if (callingClass != null && callingClass.getClassLoader() != null) { + return callingClass.getClassLoader().loadClass(className); + } } + throw ex; } } } Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java?rev=687800&r1=687799&r2=687800&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java Thu Aug 21 09:40:06 2008 @@ -31,6 +31,8 @@ import java.util.Set; import java.util.logging.Logger; +import javax.jws.WebParam; +import javax.jws.WebResult; import javax.xml.bind.annotation.XmlAttachmentRef; import javax.xml.bind.annotation.XmlList; import javax.xml.bind.annotation.XmlMimeType; @@ -293,6 +295,22 @@ AnnotationVisitor av0 = fv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true); av0.visit("name", name); + + + Annotation[] a = (Annotation[])mpi.getProperty(ReflectionServiceFactoryBean.PARAM_ANNOTATION); + if (a != null) { + for (Annotation an : a) { + String tns = null; + if (an instanceof WebParam) { + tns = ((WebParam)an).targetNamespace(); + } else if (an instanceof WebResult) { + tns = ((WebResult)an).targetNamespace(); + } + if (tns != null && !StringUtils.isEmpty(tns)) { + av0.visit("namespace", tns); + } + } + } av0.visitEnd(); List jaxbAnnos = getJaxbAnnos(mpi); Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?rev=687800&r1=687799&r2=687800&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java Thu Aug 21 09:40:06 2008 @@ -52,6 +52,7 @@ import org.apache.cxf.service.factory.ServiceConstructionException; import org.apache.cxf.service.model.InterfaceInfo; import org.apache.cxf.service.model.MessageInfo; +import org.apache.cxf.service.model.MessagePartInfo; import org.apache.cxf.service.model.OperationInfo; public class JaxWsServiceConfiguration extends AbstractServiceConfiguration { @@ -750,6 +751,24 @@ } return cls; - } + } + + public Boolean isWrapperPartQualified(MessagePartInfo mpi) { + Annotation[] annotations = (Annotation[])mpi.getProperty("parameter.annotations"); + if (annotations != null) { + for (Annotation an : annotations) { + String tns = null; + if (an instanceof WebParam) { + tns = ((WebParam)an).targetNamespace(); + } else if (an instanceof WebResult) { + tns = ((WebResult)an).targetNamespace(); + } + if (tns != null && !StringUtils.isEmpty(tns)) { + return Boolean.TRUE; + } + } + } + return null; + } } Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/ArrayService.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/ArrayService.java?rev=687800&r1=687799&r2=687800&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/ArrayService.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/ArrayService.java Thu Aug 21 09:40:06 2008 @@ -48,6 +48,7 @@ @WebMethod List listOutput(); @WebMethod - String listInput(@WebParam(name = "input")List inputs); + String listInput(@WebParam(name = "input", + targetNamespace = "http://service.jaxws.cxf.apache.org/") List inputs); } Modified: cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?rev=687800&r1=687799&r2=687800&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java Thu Aug 21 09:40:06 2008 @@ -192,6 +192,9 @@ public Boolean isWrapperPartNillable(MessagePartInfo mpi) { return null; } + public Boolean isWrapperPartQualified(MessagePartInfo mpi) { + return null; + } public Long getWrapperPartMaxOccurs(MessagePartInfo mpi) { //return Long.MAX_VALUE for unbounded return null; Modified: cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java?rev=687800&r1=687799&r2=687800&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/DefaultServiceConfiguration.java Thu Aug 21 09:40:06 2008 @@ -285,8 +285,7 @@ } return rawClass; } - - + public Boolean isWrapperPartNillable(MessagePartInfo mpi) { return (Boolean)mpi.getProperty("nillable"); } Modified: cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=687800&r1=687799&r2=687800&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Thu Aug 21 09:40:06 2008 @@ -56,6 +56,7 @@ import org.apache.cxf.catalog.CatalogXmlSchemaURIResolver; import org.apache.cxf.common.i18n.Message; import org.apache.cxf.common.logging.LogUtils; +import org.apache.cxf.common.util.StringUtils; import org.apache.cxf.common.xmlschema.SchemaCollection; import org.apache.cxf.common.xmlschema.XmlSchemaTools; import org.apache.cxf.databinding.DataBinding; @@ -1129,6 +1130,19 @@ long min = getWrapperPartMinOccurs(mpi); long max = getWrapperPartMaxOccurs(mpi); boolean nillable = isWrapperPartNillable(mpi); + Boolean qualified = isWrapperPartQualified(mpi); + if (qualified == null) { + qualified = this.isQualifyWrapperSchema(); + } + if (qualified + && StringUtils.isEmpty(mpi.getConcreteName().getNamespaceURI())) { + QName newName = new QName(wrapperName.getNamespaceURI(), + mpi.getConcreteName().getLocalPart()); + mpi.setElement(true); + mpi.setElementQName(newName); + mpi.setConcreteName(newName); + XmlSchemaTools.setElementQName(el, newName); + } if (Collection.class.isAssignableFrom(mpi.getTypeClass()) && mpi.getTypeClass().isInterface()) { @@ -1967,6 +1981,15 @@ return null; } + public Boolean isWrapperPartQualified(MessagePartInfo mpi) { + for (AbstractServiceConfiguration c : serviceConfigurations) { + Boolean b = c.isWrapperPartQualified(mpi); + if (b != null) { + return b; + } + } + return false; + } public boolean isWrapperPartNillable(MessagePartInfo mpi) { for (AbstractServiceConfiguration c : serviceConfigurations) { Boolean b = c.isWrapperPartNillable(mpi);