cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r590532 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Date Wed, 31 Oct 2007 01:41:41 GMT
Author: bimargulies
Date: Tue Oct 30 18:41:40 2007
New Revision: 590532

URL: http://svn.apache.org/viewvc?rev=590532&view=rev
Log:
Arrange for schemas created by the ReflectionServiceFactoryBean to be
added to the XmlSchemaCollection for the ServiceInfo. 

FINE a common log message instead of INFO.



Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java?rev=590532&r1=590531&r2=590532&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/injection/ResourceInjector.java
Tue Oct 30 18:41:40 2007
@@ -189,7 +189,7 @@
         } else {
             resource = resolveResource(resourceName, clz);
             
-            LOG.log(Level.INFO, "RESOURCE_RESOLVE_FAILED", new Object[] {resourceName, clz});
+            LOG.log(Level.FINE, "RESOURCE_RESOLVE_FAILED", new Object[] {resourceName, clz});
         }
     }
 

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=590532&r1=590531&r2=590532&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:41:40 2007
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.service.factory;
 
+import java.io.StringReader;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Array;
 import java.lang.reflect.Field;
@@ -80,6 +81,7 @@
 import org.apache.cxf.service.model.UnwrappedOperationInfo;
 import org.apache.cxf.wsdl.WSDLConstants;
 import org.apache.cxf.wsdl11.WSDLServiceFactory;
+import org.apache.ws.commons.schema.ValidationEventHandler;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
@@ -909,6 +911,22 @@
         }         
     }
 
+    
+    /**
+     * This is a really ugly trick to get around a bug or oversight in XmlSchema, which is
that
+     * there is no way to programmatically construct an XmlSchema instance that ends up cataloged
+     * in a collection. If there is a fix to WSCOMMONS-272, this can go away.
+     * @param collection collection to contain new schema
+     * @return new schema
+     */
+    private XmlSchema newXmlSchemaInCollection(XmlSchemaCollection collection, String namespaceURI)
{
+        StringBuffer tinyXmlSchemaDocument = new StringBuffer();
+        tinyXmlSchemaDocument.append("<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'
");
+        tinyXmlSchemaDocument.append("targetNamespace='" + namespaceURI + "'/>");
+        StringReader reader = new StringReader(tinyXmlSchemaDocument.toString());
+        return collection.read(reader, new ValidationEventHandler() { });
+    }
+
     private SchemaInfo getOrCreateSchema(ServiceInfo serviceInfo,
                                          String namespaceURI, 
                                          boolean qualified) {
@@ -921,7 +939,7 @@
         SchemaInfo schemaInfo = new SchemaInfo(serviceInfo, namespaceURI);
         XmlSchemaCollection col = serviceInfo.getXmlSchemaCollection();
 
-        XmlSchema schema = new XmlSchema(namespaceURI, col);
+        XmlSchema schema = newXmlSchemaInCollection(col, namespaceURI);
         if (qualified) {
             schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
         }



Mime
View raw message