Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 83950 invoked from network); 6 Feb 2008 03:08:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2008 03:08:58 -0000 Received: (qmail 64448 invoked by uid 500); 6 Feb 2008 03:08:50 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 64369 invoked by uid 500); 6 Feb 2008 03:08:49 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 64360 invoked by uid 99); 6 Feb 2008 03:08:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2008 19:08:49 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Feb 2008 03:08:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 88BCC1A9832; Tue, 5 Feb 2008 19:08:22 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r618862 - in /incubator/cxf/branches/2.0.x-fixes: ./ api/src/main/java/org/apache/cxf/service/model/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ systests/src/test/java/org/apache/cxf/systest/jaxws/ systests/src/test/java/org/apac... Date: Wed, 06 Feb 2008 03:08:20 -0000 To: cxf-commits@incubator.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080206030822.88BCC1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Tue Feb 5 19:08:16 2008 New Revision: 618862 URL: http://svn.apache.org/viewvc?rev=618862&view=rev Log: Merged revisions 616476 via svnmerge from https://svn.apache.org/repos/asf/incubator/cxf/trunk ........ r616476 | dkulp | 2008-01-29 13:54:00 -0500 (Tue, 29 Jan 2008) | 3 lines Fix issue with generated schemas for wrapped operations that don't match the rules for wrapped (element ref instead of type) Fix problems with faults possibly causing created schemas to not be qualified when qualified is asked for. ........ Added: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ComplexException.java - copied unchanged from r616476, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ComplexException.java Modified: incubator/cxf/branches/2.0.x-fixes/ (props changed) incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java incubator/cxf/branches/2.0.x-fixes/pom.xml incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrapped.java incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java Propchange: incubator/cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java (original) +++ incubator/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java Tue Feb 5 19:08:16 2008 @@ -29,6 +29,7 @@ import org.apache.cxf.wsdl.WSDLConstants; import org.apache.ws.commons.schema.XmlSchema; import org.apache.ws.commons.schema.XmlSchemaElement; +import org.apache.ws.commons.schema.XmlSchemaForm; public final class SchemaInfo extends AbstractPropertiesHolder { @@ -42,10 +43,14 @@ String systemId; public SchemaInfo(ServiceInfo serviceInfo, String namespaceUri) { + this(serviceInfo, namespaceUri, false, false); + } + public SchemaInfo(ServiceInfo serviceInfo, String namespaceUri, + boolean qElement, boolean qAttribute) { this.serviceInfo = serviceInfo; this.namespaceUri = namespaceUri; - this.isElementQualified = false; - this.isAttributeQualified = false; + this.isElementQualified = qElement; + this.isAttributeQualified = qAttribute; } public String toString() { @@ -126,6 +131,8 @@ public void setSchema(XmlSchema schema) { this.schema = schema; + isElementQualified = schema.getElementFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED); + isAttributeQualified = schema.getAttributeFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED); } public String getSystemId() { Modified: incubator/cxf/branches/2.0.x-fixes/pom.xml URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/pom.xml?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/pom.xml (original) +++ incubator/cxf/branches/2.0.x-fixes/pom.xml Tue Feb 5 19:08:16 2008 @@ -426,7 +426,7 @@ org.apache.maven.plugins maven-dependency-plugin - 2.0-alpha-4 + 2.0 org.apache.maven.plugins Modified: incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java (original) +++ incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java Tue Feb 5 19:08:16 2008 @@ -99,6 +99,13 @@ } boolean isElement = beanInfo.isElement(); + boolean hasType = !beanInfo.getTypeNames().isEmpty(); + if (isElement && isFromWrapper && hasType) { + //if there is both a Global element and a global type, AND we are in a wrapper, + //make sure we use the type instead of a ref to the element to + //match the rules for wrapped/unwrapped + isElement = false; + } part.setElement(isElement); @@ -178,10 +185,15 @@ } return; } - schemaInfo = new SchemaInfo(serviceInfo, qn.getNamespaceURI()); + + schemaInfo = new SchemaInfo(serviceInfo, qn.getNamespaceURI(), qualifiedSchemas, false); + el = createXsElement(part, typeName, schemaInfo); XmlSchema schema = schemas.newXmlSchemaInCollection(qn.getNamespaceURI()); + if (qualifiedSchemas) { + schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED)); + } schemaInfo.setSchema(schema); schema.getElements().add(el.getQName(), el); schema.getItems().add(el); Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java (original) +++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java Tue Feb 5 19:08:16 2008 @@ -341,6 +341,10 @@ assertEquals(3, ints.length); assertEquals(1, ints[0]); + testExceptionCases(port); + } + + private void testExceptionCases(DocLitWrappedCodeFirstService port) throws Exception { /* CXF-926 test case */ try { port.throwException(10); @@ -363,7 +367,20 @@ assertEquals("CE: -2", ex.getMessage()); assertEquals("A Value", ex.getA()); assertEquals("B Value", ex.getB()); - } + } + // CXF-1407 + try { + port.throwException(-3); + fail("Expected exception not found"); + } catch (ComplexException ex) { + assertEquals("Throw user fault -3", ex.getMessage()); + } + try { + port.throwException(-3); + fail("Expected exception not found"); + } catch (ComplexException ex) { + assertEquals("Throw user fault -3", ex.getMessage()); + } } Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java (original) +++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java Tue Feb 5 19:08:16 2008 @@ -83,7 +83,8 @@ List listObjectArrayOutput(); @WebMethod - int throwException(int i) throws ServiceTestFault, CustomException; + int throwException(int i) + throws ServiceTestFault, CustomException, ComplexException; @RequestWrapper(localName = "echoIntX") @ResponseWrapper(localName = "echoIntXResponse") Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java (original) +++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java Tue Feb 5 19:08:16 2008 @@ -120,7 +120,8 @@ return Arrays.asList(new Foo[] {a, b}, new Foo[] {c, d}); } - public int throwException(int i) throws ServiceTestFault, CustomException { + public int throwException(int i) + throws ServiceTestFault, CustomException, ComplexException { switch (i) { case -1: throw new ServiceTestFault("Hello!"); @@ -129,6 +130,14 @@ cex.setA("A Value"); cex.setB("B Value"); throw cex; + } + case -3: { + ComplexException ex = new ComplexException("Throw user fault -3"); + ex.setReason("Test"); + ComplexException.MyBean bean = new ComplexException.MyBean(); + bean.setName("Marco"); + ex.setBeans(new ComplexException.MyBean[] {bean}); + throw ex; } default: throw new ServiceTestFault(new ServiceTestFault.ServiceTestDetails(i)); Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java (original) +++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java Tue Feb 5 19:08:16 2008 @@ -47,7 +47,7 @@ @BeforeClass public static void startServers() throws Exception { - assertTrue("server did not launch correctly", launchServer(BookServer.class)); + assertTrue("server did not launch correctly", launchServer(BookServer.class, true)); } @Test Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt (original) +++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/rest/resources/expected_get_book123_xmlwrapped.txt Tue Feb 5 19:08:16 2008 @@ -1 +1 @@ -123CXF in Action \ No newline at end of file +123CXF in Action \ No newline at end of file Modified: incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrapped.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrapped.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrapped.java (original) +++ incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrapped.java Tue Feb 5 19:08:16 2008 @@ -21,6 +21,7 @@ import javax.jws.WebParam; +import javax.jws.WebResult; import javax.jws.WebService; import org.codehaus.jra.Get; @@ -32,6 +33,7 @@ @Get @HttpResource(location = "/books/{id}") + @WebResult(name = "Book") Book getBook(@WebParam(name = "id")long bookid) throws BookNotFoundFault; Modified: incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java?rev=618862&r1=618861&r2=618862&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java (original) +++ incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java Tue Feb 5 19:08:16 2008 @@ -23,6 +23,7 @@ import javax.jws.WebMethod; import javax.jws.WebParam; +import javax.jws.WebResult; import javax.jws.WebService; import org.apache.cxf.customer.Customer; @@ -47,6 +48,7 @@ @Get @HttpResource(location = "/customers") @WebMethod + @WebResult(name = "customers") public Customers getCustomers() { Customers cbean = new Customers(); cbean.setCustomer(customers.values()); @@ -56,6 +58,7 @@ @Get @HttpResource(location = "/customers/{id}") @WebMethod + @WebResult(name = "customer") public Customer getCustomer(@WebParam(name = "id") Long id) { return customers.get(id); } @@ -63,7 +66,8 @@ @Put @HttpResource(location = "/customers/{id}") @WebMethod - public void updateCustomer(@WebParam(name = "id") String id, Customer c) { + public void updateCustomer(@WebParam(name = "id") String id, + @WebParam(name = "customer") Customer c) { customers.put(c.getId(), c); }