cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
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 GMT
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 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-dependency-plugin</artifactId>
-                    <version>2.0-alpha-4</version>
+                    <version>2.0</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>

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<Foo[]> 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 @@
-<ns1:getBookResponse xmlns:ns1="http://book.customer.cxf.apache.org/"><Book xmlns="http://book.acme.com"><id>123</id><name>CXF
in Action</name></Book></ns1:getBookResponse>
\ No newline at end of file
+<ns1:getBookResponse xmlns:ns1="http://book.customer.cxf.apache.org/"><ns2:Book
xmlns:ns2="http://book.customer.cxf.apache.org/" xmlns="http://book.acme.com"><id>123</id><name>CXF
in Action</name></ns2:Book></ns1:getBookResponse>
\ 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);
     }
 



Mime
View raw message