cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r590526 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/core/src/test/java/org/apache/cxf/wsdl11/ rt/data...
Date Wed, 31 Oct 2007 01:13:45 GMT
Author: bimargulies
Date: Tue Oct 30 18:13:44 2007
New Revision: 590526

URL: http://svn.apache.org/viewvc?rev=590526&view=rev
Log:
Some rationalization of the XmlSchemaCollection usage associated with
ServiceInfo objects. Get rid of the use of a property on the
ServiceInfo (using the get/setProperty API) since the schema
collection object actually built into the ServiceInfo works perfectly fine. 

There is work left to do in ReflectionServiceFactoryBean to get
schemata that it builds itself into the collection.


 --This line, and those below, will be ignored--

M    rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
M    rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
M    rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
M    rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
M    rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
M    rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
M    rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
M    rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
M    rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
M    tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
M    api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
    incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
    incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
    incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java Tue
Oct 30 18:13:44 2007
@@ -40,6 +40,7 @@
     private XmlSchemaCollection xmlSchemaCollection;
 
     public ServiceInfo() {
+        xmlSchemaCollection = new XmlSchemaCollection();
     }
 
     public String getTargetNamespace() {
@@ -138,10 +139,6 @@
 
     public Collection<SchemaInfo> getSchemas() {
         return Collections.unmodifiableCollection(schemas);
-    }
-
-    public void setXmlSchemaCollection(XmlSchemaCollection col) {
-        this.xmlSchemaCollection = col;
     }
 
     public XmlSchemaCollection getXmlSchemaCollection() {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Tue Oct 30 18:13:44 2007
@@ -389,8 +389,7 @@
 
         if (header != null && serviceInfo.getMessage(header.getMessage()) == null)
{
             Definition def = (Definition)serviceInfo.getProperty(WSDLServiceBuilder.WSDL_DEFINITION);
-            XmlSchemaCollection schemas = (XmlSchemaCollection)serviceInfo
-                .getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST);
+            XmlSchemaCollection schemas = serviceInfo.getXmlSchemaCollection();
 
             if (def != null && schemas != null) {
                 javax.wsdl.Message msg = def.getMessage(header.getMessage());

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Tue Oct 30 18:13:44 2007
@@ -187,10 +187,9 @@
                 ServiceInfo service = new ServiceInfo();
                 service.setDescription(description);
                 service.setProperty(WSDL_DEFINITION, def);
-                XmlSchemaCollection schemas = getSchemas(def, service);
+                getSchemas(def, service);
 
                 service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
-                service.setProperty(WSDL_SCHEMA_LIST, schemas);
                 serviceList.add(service);
             }
         }
@@ -208,12 +207,10 @@
         ServiceInfo service = new ServiceInfo();
         service.setDescription(description);
         service.setProperty(WSDL_DEFINITION, def);
-        XmlSchemaCollection schemas = getSchemas(def, service);
+        getSchemas(def, service);
 
         service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
 
-        service.setProperty(WSDL_SCHEMA_LIST, schemas);
-
         buildInterface(service, p);
 
         return service;
@@ -249,9 +246,8 @@
                 service.setProperty(WSDL_DEFINITION, def);
                 service.setProperty(WSDL_SERVICE, serv);
 
-                XmlSchemaCollection schemas = getSchemas(def, service);
+                getSchemas(def, service);
                 service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
-                service.setProperty(WSDL_SCHEMA_LIST, schemas);
                 service.setTargetNamespace(def.getTargetNamespace());
                 service.setName(serv.getQName());
                 copyExtensors(service, serv.getExtensibilityElements());
@@ -272,9 +268,8 @@
         return new ArrayList<ServiceInfo>(services.values());
     }
 
-    private XmlSchemaCollection getSchemas(Definition def, ServiceInfo serviceInfo) {
-        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
-        serviceInfo.setXmlSchemaCollection(schemaCol);
+    private void getSchemas(Definition def, ServiceInfo serviceInfo) {
+        XmlSchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
         schemaCol.getExtReg().setDefaultExtensionDeserializer(
             new FixedExtensionDeserializer());
 
@@ -288,8 +283,6 @@
             // added
             getSchemaList(def2);
         }
-
-        return schemaCol;
     }
 
     private void parseImports(Definition def, List<Definition> defList) {
@@ -641,8 +634,7 @@
         if (!passedRule) {
             return;
         }
-        XmlSchemaCollection schemas = (XmlSchemaCollection)opInfo.getInterface().getService()
-            .getProperty(WSDL_SCHEMA_LIST);
+        XmlSchemaCollection schemas = opInfo.getInterface().getService().getXmlSchemaCollection();
         XmlSchemaElement inputEl = null;
         XmlSchemaElement outputEl = null;
 
@@ -790,8 +782,8 @@
     }
 
     private void buildMessage(AbstractMessageContainer minfo, Message msg) {
-        XmlSchemaCollection schemas = (XmlSchemaCollection)minfo.getOperation().getInterface().getService()
-            .getProperty(WSDL_SCHEMA_LIST);
+        XmlSchemaCollection schemas = minfo.getOperation().getInterface().getService()
+            .getXmlSchemaCollection();
         List orderedParam = msg.getOrderedParts(null);
         for (Part part : cast(orderedParam, Part.class)) {
             MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(),
part

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
(original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
Tue Oct 30 18:13:44 2007
@@ -363,8 +363,7 @@
 
     @Test
     public void testSchema() {
-        XmlSchemaCollection schemas = serviceInfo.getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST,
-                XmlSchemaCollection.class);
+        XmlSchemaCollection schemas = serviceInfo.getXmlSchemaCollection();
         assertNotNull(schemas);
         assertEquals(serviceInfo.getSchemas().size(), 1);
         SchemaInfo schemaInfo = serviceInfo.getSchemas().iterator().next();

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
Tue Oct 30 18:13:44 2007
@@ -59,7 +59,6 @@
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaAnnotated;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
@@ -312,17 +311,11 @@
             types.add(t);
         }
         for (ServiceInfo si : s.getServiceInfos()) {
-            XmlSchemaCollection col = (XmlSchemaCollection)si
-                .getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST);
-
-            if (col != null) {
+            XmlSchemaCollection col = si.getXmlSchemaCollection();
+            if (col.getXmlSchemas().length > 1) {
                 // someone has already filled in the types
                 continue;
             }
-    
-            col = new XmlSchemaCollection();
-            si.setProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST, col);
-            si.setXmlSchemaCollection(col);
         }
 
         for (Map.Entry<String, Set<Type>> entry : tns2Type.entrySet()) {
@@ -378,8 +371,7 @@
                 org.w3c.dom.Document schema = new DOMOutputter().output(new Document(e));
 
                 for (ServiceInfo si : s.getServiceInfos()) {
-                    XmlSchemaCollection col = (XmlSchemaCollection)si
-                        .getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST);
+                    XmlSchemaCollection col = si.getXmlSchemaCollection();
                     col.setNamespaceContext(nsMap);
                     XmlSchema xmlSchema = addSchemaDocument(si, col, schema, entry.getKey());
                     // Work around bug in JDOM DOMOutputter which fails to correctly

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Tue Oct 30 18:13:44 2007
@@ -69,7 +69,6 @@
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.ws.addressing.ObjectFactory;
-import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 
 public final class JAXBDataBinding extends AbstractDataBinding implements DataBinding {
@@ -206,16 +205,13 @@
         
             
         for (ServiceInfo serviceInfo : service.getServiceInfos()) {
-            XmlSchemaCollection col = (XmlSchemaCollection)serviceInfo
-                .getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST);
-    
-            if (col != null) {
+            XmlSchemaCollection col = serviceInfo.getXmlSchemaCollection();
+
+            if (col.getXmlSchemas().length > 1) {
                 // someone has already filled in the types
                 continue;
             }
     
-            col = new XmlSchemaCollection();
-    
             Collection<DOMSource> schemas = getSchemas();
             if (schemas != null) {
                 for (DOMSource r : schemas) {
@@ -233,7 +229,6 @@
                 }
             }
             
-            serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST, col);
             JAXBContextImpl riContext;
             if (context instanceof JAXBContextImpl) {
                 riContext = (JAXBContextImpl) context;

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Tue Oct 30 18:13:44 2007
@@ -87,6 +87,7 @@
 import org.apache.ws.commons.schema.XmlSchemaForm;
 import org.apache.ws.commons.schema.XmlSchemaImport;
 import org.apache.ws.commons.schema.XmlSchemaObject;
+import org.apache.ws.commons.schema.XmlSchemaObjectTable;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
 import org.apache.ws.commons.schema.constants.Constants;
@@ -174,10 +175,75 @@
         getService().put(MethodDispatcher.class.getName(), getMethodDispatcher());
 
         createEndpoints();
+        
+        fillInSchemaCrossreferences();
 
         return getService();
     }
 
+    private void fillInSchemaCrossreferences() {
+        Service service = getService();
+        for (ServiceInfo serviceInfo : service.getServiceInfos()) {
+            XmlSchemaCollection schemaCollection = serviceInfo.getXmlSchemaCollection();
+            
+            // First pass, fill in any types for which we have a name but no type.
+            for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
+                XmlSchemaObjectTable elementsTable = schemaInfo.getSchema().getElements();
+                Iterator elementsIterator = elementsTable.getNames();
+                while (elementsIterator.hasNext()) {
+                    QName elementName = (QName)elementsIterator.next();
+                    XmlSchemaElement element = schemaInfo.getSchema().getElementByName(elementName);
+                    if (element.getSchemaType() == null) {
+                        QName typeName = element.getSchemaTypeName();
+                        if (typeName != null) {
+                            XmlSchemaType type = schemaCollection.getTypeByQName(typeName);
+                            if (type == null) {
+                                Message message = new Message("REFERENCE_TO_UNDEFINED_TYPE",
LOG, 
+                                                              element.getQName(),
+                                                              typeName,
+                                                              service.getName());
+                                LOG.severe(message.toString());
+                            } else {
+                                element.setSchemaType(type);
+                            }
+                        }
+                    }
+                }
+                
+            }
+            
+            // second pass. Fill in based on refs.
+            for (SchemaInfo schemaInfo : serviceInfo.getSchemas()) {
+                XmlSchemaObjectTable elementsTable = schemaInfo.getSchema().getElements();
+                Iterator elementsIterator = elementsTable.getNames();
+                while (elementsIterator.hasNext()) {
+                    QName elementName = (QName)elementsIterator.next();
+                    XmlSchemaElement element = schemaInfo.getSchema().getElementByName(elementName);
+                    if (element.getSchemaType() == null) {
+                        QName refElementName = element.getRefName();
+                        if (refElementName != null) {
+                            XmlSchemaElement refElement = 
+                                schemaCollection.getElementByQName(refElementName);
+                            if (refElement == null) {
+                                Message message = new Message("REFERENCE_TO_UNDEFINED_ELEMENT",
+                                                              LOG,
+                                                              element.getQName(),
+                                                              refElementName,
+                                                              service.getName());
+                                LOG.severe(message.toString());
+                            } else {
+                                // it is convenient for other consumers if we put the type
in place.
+                                // we trust that anything generating XSD will avoid something
stupid like:
+                                // <element ref='x' type='y'/> as a result.
+                                element.setSchemaType(refElement.getSchemaType());
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     protected void createEndpoints() {
         Service service = getService();
 
@@ -237,6 +303,9 @@
         }
         
         ServiceInfo serviceInfo = new ServiceInfo();
+        XmlSchemaCollection col = serviceInfo.getXmlSchemaCollection();
+        col.getExtReg().registerSerializer(MimeAttribute.class, new MimeSerializer());
+
         ServiceImpl service = new ServiceImpl(serviceInfo);
 
         setService(service);
@@ -850,13 +919,12 @@
         }
 
         SchemaInfo schemaInfo = new SchemaInfo(serviceInfo, namespaceURI);
-        XmlSchemaCollection col = new XmlSchemaCollection();
-        col.getExtReg().registerSerializer(MimeAttribute.class, new MimeSerializer());
+        XmlSchemaCollection col = serviceInfo.getXmlSchemaCollection();
+
         XmlSchema schema = new XmlSchema(namespaceURI, col);
         if (qualified) {
             schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
         }
-        serviceInfo.setXmlSchemaCollection(col);
         schemaInfo.setSchema(schema);
 
         Map<String, String> explicitNamespaceMappings = this.getDataBinding().getDeclaredNamespaceMappings();

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
Tue Oct 30 18:13:44 2007
@@ -24,5 +24,5 @@
 USING_PROXY_FOR_SERVICE = Service class: {0} is a java.lang.reflect.Proxy instance.  This
is known not to work well as \
   annotations on the real instance are not available.  We suggest overriding the ServiceClass
via spring config or \
   other configuration. (serviceClass/implementorClass attributes on the endpoint/server spring
config entry)
- 
- 
\ No newline at end of file
+REFERENCE_TO_UNDEFINED_TYPE = Schema element {0} references undefined type {1} for service
{2}.
+REFERENCE_TO_UNDEFINED_ELEMENT = Schema element {0} references undefined element {1} for
service {2}.
\ No newline at end of file

Modified: incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/main/java/org/apache/cxf/javascript/types/SchemaJavascriptBuilder.java
Tue Oct 30 18:13:44 2007
@@ -239,6 +239,7 @@
             
             XmlSchemaElement elChild = (XmlSchemaElement)thing;
             XmlSchemaType elType = elChild.getSchemaType();
+            assert elType != null;
             boolean nillable = elChild.isNillable();
             if (elChild.isAbstract()) { 
                 unsupportedConstruct("ABSTRACT_ELEMENT", elChild.getName(), type);

Modified: incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
(original)
+++ incubator/cxf/trunk/rt/javascript/src/test/java/org/apache/cxf/javascript/fortest/TestBean1.java
Tue Oct 30 18:13:44 2007
@@ -1,42 +1,43 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.javascript.fortest;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * Bean with a selection of elements suitable for testing the JavaScript client.
- */
-@XmlType(namespace = "uri:org.apache.cxf.javascript.testns")
-public class TestBean1 {
-    //CHECKSTYLE:OFF
-    public String stringItem;
-    public int intItem;
-    @XmlElement(defaultValue = "43")
-    public long longItem;
-    public byte[] base64Item;
-    @XmlElement(required = false)
-    public int optionalIntItem;
-    @XmlElement(required = false)
-    public int[] optionalIntArrayItem;
-    
-    //CHECKSTYLE:ON
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.javascript.fortest;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Bean with a selection of elements suitable for testing the JavaScript client.
+ */
+@XmlType(namespace = "uri:org.apache.cxf.javascript.testns")
+public class TestBean1 {
+    //CHECKSTYLE:OFF
+    public String stringItem;
+    @XmlElement(namespace = "uri:org.apache.cxf.javascript.testns2")
+    public int intItem;
+    @XmlElement(defaultValue = "43")
+    public long longItem;
+    public byte[] base64Item;
+    @XmlElement(required = false)
+    public int optionalIntItem;
+    @XmlElement(required = false)
+    public int[] optionalIntArrayItem;
+    
+    //CHECKSTYLE:ON
+}

Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java?rev=590526&r1=590525&r2=590526&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ProcessorUtil.java
Tue Oct 30 18:13:44 2007
@@ -49,7 +49,6 @@
 import org.apache.cxf.tools.util.NameUtil;
 import org.apache.cxf.tools.util.URIParserUtil;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
-import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
@@ -355,8 +354,7 @@
         List<WrapperElement> qnames = new ArrayList<WrapperElement>();
         
         ServiceInfo serviceInfo = (ServiceInfo)context.get(ServiceInfo.class);
-        XmlSchemaCollection schema = (XmlSchemaCollection)serviceInfo
-            .getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST);
+        XmlSchemaCollection schema = serviceInfo.getXmlSchemaCollection();
        
         XmlSchemaElement elementByName = schema.getElementByQName(partElement);
         
@@ -397,8 +395,8 @@
     
     public static boolean isSchemaFormQualified(ToolContext context, QName partElement) {
         ServiceInfo serviceInfo = (ServiceInfo)context.get(ServiceInfo.class);
-        XmlSchemaCollection schemaCol = (XmlSchemaCollection)serviceInfo
-            .getProperty(WSDLServiceBuilder.WSDL_SCHEMA_LIST);
+        XmlSchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
+
         for (int i = 0; i < schemaCol.getXmlSchemas().length; i++) {
             XmlSchema schema = schemaCol.getXmlSchemas().clone()[i];
             if (schema.getElementByName(partElement) != null) {



Mime
View raw message