gdaniels    02/03/20 08:14:29

  Modified:    java/src/org/apache/axis Version.java
  Log:
  Add the ability to query a remote Axis server for its version.
  
  Revision  Changes    Path
  1.3       +18 -1     xml-axis/java/src/org/apache/axis/Version.java
  
  Index: Version.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Version.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Version.java      14 Feb 2002 23:01:48 -0000      1.2
  +++ Version.java      20 Mar 2002 16:14:29 -0000      1.3
  @@ -56,6 +56,7 @@
   package org.apache.axis;
   
   import org.apache.axis.utils.JavaUtils;
  +import org.apache.axis.client.Call;
   
   /**
    * Little utility to get the version and build date of the axis.jar.
  @@ -72,7 +73,23 @@
                  JavaUtils.getMessage("builtOn");
       }
       
  +    /**
  +     * Entry point.
  +     * 
  +     * Calling this with no arguments returns the version of the client-side
  +     * axis.jar.  Passing a URL which points to a remote Axis server will
  +     * attempt to retrieve the version of the server via a SOAP call.
  +     */ 
       public static void main(String[] args) {
  -        System.out.println(getVersion());
  +        if (args.length != 1)
  +            System.out.println(getVersion());
  +        
  +        try {
  +            Call call = new Call(args[0]);
  +            String result = (String)call.invoke("Version", "getVersion", null);
  +            System.out.println(result);
  +        } catch (Exception e) {
  +            e.printStackTrace();
  +        }
       }
   }
  
  
  


Reply via email to