axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r522319 - in /webservices/axis2/trunk/java/modules: java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
Date Sun, 25 Mar 2007 18:35:21 GMT
Author: dims
Date: Sun Mar 25 11:35:19 2007
New Revision: 522319

URL: http://svn.apache.org/viewvc?view=rev&rev=522319
Log:
If we don't understand any of the built-in classes in the java.lang.* and javax.*, just treat
them as xs:anyType

Modified:
    webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java

Modified: webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java?view=diff&rev=522319&r1=522318&r2=522319
==============================================================================
--- webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
(original)
+++ webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
Sun Mar 25 11:35:19 2007
@@ -2,6 +2,8 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.ws.java2wsdl.Java2WSDLConstants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 import java.util.*;
@@ -25,11 +27,14 @@
 
 public class TypeTable {
     private HashMap simpleTypetoxsd;
-    private HashMap complecTypeMap;
+    private HashMap complexTypeMap;
+
+    private static final Log log = LogFactory.getLog(TypeTable.class);
+    private static final QName ANY_TYPE = new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD,
"anyType", "xs");
 
     public TypeTable() {
         simpleTypetoxsd = new HashMap();
-        complecTypeMap = new HashMap();
+        complexTypeMap = new HashMap();
         populateSimpleTypes();
     }
 
@@ -52,7 +57,7 @@
         simpleTypetoxsd.put("byte",
                 new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "byte", "xs"));
         simpleTypetoxsd.put("char",
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                ANY_TYPE);
         simpleTypetoxsd.put("java.lang.Integer",
                 new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "int", "xs"));
         simpleTypetoxsd.put("java.lang.Double",
@@ -62,7 +67,7 @@
         simpleTypetoxsd.put("java.lang.Long",
                 new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "long", "xs"));
         simpleTypetoxsd.put("java.lang.Character",
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                ANY_TYPE);
         simpleTypetoxsd.put("java.lang.Boolean",
                 new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "boolean", "xs"));
         simpleTypetoxsd.put("java.lang.Byte",
@@ -75,28 +80,34 @@
                 new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "dateTime", "xs"));
 
         simpleTypetoxsd.put("java.lang.Object",
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                ANY_TYPE);
 
         // Any types
         simpleTypetoxsd.put(OMElement.class.getName(),
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                ANY_TYPE);
         simpleTypetoxsd.put(ArrayList.class.getName(),
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                ANY_TYPE);
         simpleTypetoxsd.put(Vector.class.getName(),
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                ANY_TYPE);
         simpleTypetoxsd.put(List.class.getName(),
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                ANY_TYPE);
          simpleTypetoxsd.put(HashMap.class.getName(),
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                 ANY_TYPE);
          simpleTypetoxsd.put(Hashtable.class.getName(),
-                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "anyType", "xs"));
+                 ANY_TYPE);
         //byteArrat
         simpleTypetoxsd.put("base64Binary",
                 new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "base64Binary", "xs"));
     }
 
-    public QName getSimpleSchemaTypeName(String typename) {
-        return (QName) simpleTypetoxsd.get(typename);
+    public QName getSimpleSchemaTypeName(String typeName) {
+        QName qName = (QName) simpleTypetoxsd.get(typeName);
+        if(qName == null){
+            if(typeName.startsWith("java.lang")||typeName.startsWith("javax.")){
+                return ANY_TYPE;
+            }
+        }
+        return qName;
     }
 
     public boolean isSimpleType(String typeName) {
@@ -107,15 +118,18 @@
                 return true;
             }
         }
+        if(typeName.startsWith("java.lang")||typeName.startsWith("javax.")){
+            return true;
+        }
         return false;
     }
 
     public void addComplexSchema(String name, QName schemaType) {
-        complecTypeMap.put(name, schemaType);
+        complexTypeMap.put(name, schemaType);
     }
 
     public QName getComplexSchemaType(String name) {
-        return (QName) complecTypeMap.get(name);
+        return (QName) complexTypeMap.get(name);
     }
 
     public QName getQNamefortheType(String typeName) {

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=522319&r1=522318&r2=522319
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
Sun Mar 25 11:35:19 2007
@@ -137,8 +137,7 @@
         suite.addTestSuite(JAXBProviderTests.class);
         suite.addTestSuite(ProxyTests.class);
         suite.addTestSuite(ProxyNonWrappedTests.class);
-// TODO: Fix me. Test fails in latest svn
-//        suite.addTestSuite(RPCProxyTests.class);
+        suite.addTestSuite(RPCProxyTests.class);
         suite.addTestSuite(GorillaDLWProxyTests.class);
         suite.addTestSuite(SOAP12ProxyTests.class);
         suite.addTestSuite(ExceptionFactoryTests.class);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message