axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/test/encoding TestArrayListConversions.java
Date Sun, 01 Jul 2001 12:38:47 GMT
gdaniels    01/07/01 05:38:47

  Modified:    java/src/org/apache/axis/providers/java JavaProvider.java
               java/test/encoding TestArrayListConversions.java
  Log:
  Improve error handling for JavaProviders - throw a more informative
  fault if the className / methodName properties are not set on the
  Service.
  
  NOTE: a null methodName property used to allow access to any
  method in the target class.  Now we throw an Exception for an
  unspecified methodName, and if you want the "any" behaviour,
  you use a value of "*".
  
  Revision  Changes    Path
  1.4       +21 -0     xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JavaProvider.java	2001/06/14 07:04:10	1.3
  +++ JavaProvider.java	2001/07/01 12:38:46	1.4
  @@ -182,6 +182,27 @@
           String  clsName    = (String) service.getOption( "className" );
           String  methodName = (String) service.getOption( "methodName" );
           
  +        if ((clsName == null) || clsName.equals(""))
  +          throw new AxisFault("Server.NoClassForService",
  +            "No 'className' option was configured for the service '" +
  +               serviceName + "'",
  +            null, null);
  +        
  +        /** ??? Should we enforce setting methodName?  As it was,
  +         * if it's null, we allowed any method.  This seems like it might
  +         * be considered somewhat insecure (it's an easy mistake to
  +         * make).  Tossing an Exception if it's not set, and using "*"
  +         * to explicitly indicate "any method" is probably better.
  +         */
  +        if ((methodName == null) || methodName.equals(""))
  +          throw new AxisFault("Server.NoMethodConfig",
  +            "No 'methodName' option was configured for the service '" +
  +               serviceName + "'",
  +            null, null);
  +        
  +        if (methodName.equals("*"))
  +          methodName = null;
  +        
           try {
               /* We know we're doing a Java/RPC call so we can ask for the */
               /* SOAPBody as an RPCBody and process it accordingly.        */
  
  
  
  1.3       +1 -0      xml-axis/java/test/encoding/TestArrayListConversions.java
  
  Index: TestArrayListConversions.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestArrayListConversions.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestArrayListConversions.java	2001/07/01 03:48:25	1.2
  +++ TestArrayListConversions.java	2001/07/01 12:38:47	1.3
  @@ -48,6 +48,7 @@
       Handler disp = hr.find("RPCDispatcher");    
       SOAPService service = new SOAPService(disp, "RPCDispatcher");
       service.addOption("className", "test.encoding.TestArrayListConversions");
  +    service.addOption("methodName", "*");
       
       server.deployService(SERVICE_NAME, service);
       
  
  
  

Mime
View raw message