cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r786582 - in /cxf/trunk: api/src/main/java/org/apache/cxf/databinding/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service...
Date Fri, 19 Jun 2009 17:06:18 GMT
Author: dkulp
Date: Fri Jun 19 17:06:18 2009
New Revision: 786582

URL: http://svn.apache.org/viewvc?rev=786582&view=rev
Log:
[CXF-1822] If schema DOM is passed in, set the element so it's reused.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SchemaFirstXmlConfigTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Foo.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/echoFoo.xsd
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java?rev=786582&r1=786581&r2=786582&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractDataBinding.java Fri Jun
19 17:06:18 2009
@@ -134,6 +134,7 @@
         synchronized (d) {
             xmlSchema = col.read(d, systemId, null);
             schema.setSchema(xmlSchema);
+            schema.setElement(d.getDocumentElement());
         }
         serviceInfo.addSchema(schema);
         return xmlSchema;

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=786582&r1=786581&r2=786582&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Fri Jun 19 17:06:18 2009
@@ -331,6 +331,7 @@
         el.setNillable(true);
         el.setSchemaTypeName(typeName);
         part.setXmlSchema(el);
+        schemaInfo.setElement(null);
         return el;
     }
     
@@ -348,13 +349,14 @@
             SchemaInfo schemaInfo = serviceInfo.getSchema(part.getElementQName().getNamespaceURI());
             if (schemaInfo != null
                 && !isExistSchemaElement(schemaInfo.getSchema(), part.getElementQName()))
{
-                    
+                
                 XmlSchemaElement el = new XmlSchemaElement();
                 XmlSchemaUtils.setElementQName(el, part.getElementQName());
                 el.setNillable(true);
                 
                 schemaInfo.getSchema().getItems().add(el);
                 schemaInfo.getSchema().getElements().add(el.getQName(), el);
+                schemaInfo.setElement(null);
 
                 Iterator<QName> itr = beanInfo.getTypeNames().iterator();
                 if (!itr.hasNext()) {
@@ -387,6 +389,7 @@
             
             schemaInfo.getSchema().getItems().add(el);
             schemaInfo.getSchema().getElements().add(el.getQName(), el);
+            schemaInfo.setElement(null);
 
             part.setXmlSchema(el);
 
@@ -478,6 +481,7 @@
         
         schema.getItems().add(ct);
         schema.addType(ct);
+        schemaInfo.setElement(null);
         el.setSchemaTypeName(part.getElementQName());
         
         XmlSchemaSequence seq = new XmlSchemaSequence();

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SchemaFirstXmlConfigTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SchemaFirstXmlConfigTest.java?rev=786582&r1=786581&r2=786582&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SchemaFirstXmlConfigTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SchemaFirstXmlConfigTest.java
Fri Jun 19 17:06:18 2009
@@ -23,6 +23,8 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
+import org.apache.cxf.helpers.XMLUtils;
+
 import org.junit.Test;
 
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -48,6 +50,8 @@
 
         Document d = getWSDLDocument(serverFB.getServer());
 
+        XMLUtils.printDOM(d);
+        
         // XmlSchema still isn't preserving all the extra info...
         assertValid("//xsd:complexType[@name='foo']/xsd:sequence", d);
         

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Foo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Foo.java?rev=786582&r1=786581&r2=786582&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Foo.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Foo.java Fri Jun
19 17:06:18 2009
@@ -18,6 +18,9 @@
  */
 package org.apache.cxf.jaxws.service;
 
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "foo", namespace = "http://service.jaxws.cxf.apache.org/fooStuff")
 public class Foo {
 
 }

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/echoFoo.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/echoFoo.xsd?rev=786582&r1=786581&r2=786582&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/echoFoo.xsd (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/echoFoo.xsd Fri
Jun 19 17:06:18 2009
@@ -1,7 +1,7 @@
 <xs:schema xmlns="http://service.jaxws.cxf.apache.org/"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   attributeFormDefault="unqualified" elementFormDefault="unqualified"
-  targetNamespace="http://service.jaxws.cxf.apache.org/">
+  targetNamespace="http://service.jaxws.cxf.apache.org/fooStuff">
   <xs:complexType name="foo">
     <xs:annotation>
       bibbity bob

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=786582&r1=786581&r2=786582&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Fri Jun 19 17:06:18 2009
@@ -946,6 +946,7 @@
         SchemaInfo si = getOrCreateSchema(serviceInfo, mpi.getElementQName().getNamespaceURI(),
                                           getQualifyWrapperSchema());
         XmlSchema schema = si.getSchema();
+        si.setElement(null); //cached element is now invalid
 
         XmlSchemaElement el = new XmlSchemaElement();
         XmlSchemaUtils.setElementQName(el, mpi.getElementQName());
@@ -994,7 +995,7 @@
         SchemaInfo schemaInfo = getOrCreateSchema(serviceInfo, wrapperBeanName.getNamespaceURI(),
                                                   getQualifyWrapperSchema());
 
-        createWrappedMessageSchema(serviceInfo, wrappedMessage, unwrappedMessage, schemaInfo.getSchema(),
+        createWrappedMessageSchema(serviceInfo, wrappedMessage, unwrappedMessage, schemaInfo,
                                    wrapperBeanName);
     }
 
@@ -1054,6 +1055,7 @@
                 }
             }
 
+            schemaInfo.setElement(null); //cached element is now invalid
             XmlSchemaElement el = new XmlSchemaElement();
             XmlSchemaUtils.setElementQName(el, qname);
             el.setNillable(true);
@@ -1145,9 +1147,11 @@
     }
 
     private void createWrappedMessageSchema(ServiceInfo serviceInfo, AbstractMessageContainer
wrappedMessage,
-                                            AbstractMessageContainer unwrappedMessage, XmlSchema
schema,
+                                            AbstractMessageContainer unwrappedMessage, SchemaInfo
info,
                                             QName wrapperName) {
 
+        XmlSchema schema = info.getSchema();
+        info.setElement(null); // the cached schema will be no good
         XmlSchemaElement el = new XmlSchemaElement();
         XmlSchemaUtils.setElementQName(el, wrapperName);
         SchemaCollection.addGlobalElementToSchema(schema, el);

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java?rev=786582&r1=786581&r2=786582&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
Fri Jun 19 17:06:18 2009
@@ -52,7 +52,8 @@
 
     public static final List<String> DEFAULT_IGNORE_ATTR = Arrays.asList(new String[]{"attributeFormDefault",
                                                                                       "elementFormDefault",

-                                                                                      "form"});
+                                                                                      "form",
+                                                                                      "version"});
     public static final List<String> DEFAULT_IGNORE_TAG = Arrays.asList(new String[]{"sequence"});
 
     protected ToolContext env = new ToolContext();



Mime
View raw message