axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r483180 - in /webservices/axis2/trunk/java/modules/jaxws: src/org/apache/axis2/jaxws/description/ src/org/apache/axis2/jaxws/marshaller/impl/alt/ src/org/apache/axis2/jaxws/util/ test/org/apache/axis2/jaxws/sample/
Date Wed, 06 Dec 2006 19:15:25 GMT
Author: scheu
Date: Wed Dec  6 11:15:24 2006
New Revision: 483180

URL: http://svn.apache.org/viewvc?view=rev&rev=483180
Log:
AXIS2-1799
Contributor:Rich Scheuerle and Min Zheng
SimpleFault test plus enabling code in the JAX-WS engine.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/FaultDescription.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/ClassUtils.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/FaultDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/FaultDescription.java?view=diff&rev=483180&r1=483179&r2=483180
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/FaultDescription.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/FaultDescription.java
Wed Dec  6 11:15:24 2006
@@ -44,6 +44,12 @@
  */
 public interface FaultDescription {
     public OperationDescription getOperationDescription();
+    
+    
+    /**
+     * @return the name of the JAXB type defined in the schema for this exception.  Note
that this is usually
+     * a bean, but it could also be a java primitive
+     */
     public String getFaultBean();
     public String getName();
     public String getTargetNamespace();

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?view=diff&rev=483180&r1=483179&r2=483180
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
Wed Dec  6 11:15:24 2006
@@ -590,7 +590,7 @@
             
             // Construct the JAX-WS generated exception that holds the faultBeanObject
             Class exceptionClass = loadClass(faultDesc.getExceptionClassName());
-            Class faultBeanFormalClass = loadClass(faultDesc.getFaultBean());           

+            Class faultBeanFormalClass = loadClass(faultDesc.getFaultBean());  // Note that
faultBean may not be a bean, it could be a primitive     
             exception =createServiceException(xmlfault.getReason().getText(), exceptionClass,
faultBeanObject, faultBeanFormalClass);
         }
         return exception;
@@ -643,7 +643,11 @@
     static Class loadClass(String className)throws ClassNotFoundException{
         // TODO J2W AccessController Needed
         // Don't make this public, its a security exposure
-        return Class.forName(className, true, Thread.currentThread().getContextClassLoader());
+        Class cls = ClassUtils.getPrimitiveClass(className);
+        if (cls == null) {
+            cls = Class.forName(className, true, Thread.currentThread().getContextClassLoader());
+        }
+        return cls;
     }
     
     /** Create a JAX-WS Service Exception (Generated Exception)

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/ClassUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/ClassUtils.java?view=diff&rev=483180&r1=483179&r2=483180
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/ClassUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/ClassUtils.java
Wed Dec  6 11:15:24 2006
@@ -97,11 +97,6 @@
      */
     public static String getLoadableClassName(String text) {
         int bracket = text.indexOf("[");
-        if (text == null || 
-            bracket < 0 || // no array
-            bracket == 0) { // or already loadable
-            return text;
-        }
         String className = text;
 
         // Get the className without any array brackets
@@ -234,6 +229,14 @@
 			return null;
 		}
 	}
+    
+    /**
+     * @param name of primitive type
+     * @return primitive Class or null 
+     */
+    public static Class getPrimitiveClass(String text) {
+        return (Class) loadClassMap.get(text);
+    }
     
     /**
      * @param cls

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java?view=diff&rev=483180&r1=483179&r2=483180
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/FaultsServiceTests.java
Wed Dec  6 11:15:24 2006
@@ -146,9 +146,8 @@
     
     /**
      * Tests that throwing of SimpleFault
-     * Disabled while I fix this test
      */
-    public void _testFaultsService4(){
+    public void testFaultsService4(){
         Exception exception = null;
         try{
             FaultsServicePortType proxy = getProxy();



---------------------------------------------------------------------
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