You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2001/10/17 22:53:05 UTC

cvs commit: xml-axis/java/samples/transport FileTest.java

gdaniels    01/10/17 13:53:04

  Modified:    java/samples/transport FileTest.java
  Log:
  Clean up code before mods.
  
  Revision  Changes    Path
  1.15      +38 -44    xml-axis/java/samples/transport/FileTest.java
  
  Index: FileTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/FileTest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- FileTest.java	2001/10/15 19:24:00	1.14
  +++ FileTest.java	2001/10/17 20:53:04	1.15
  @@ -1,18 +1,12 @@
   package samples.transport ;
   
  -import java.lang.Thread ;
  +import org.apache.axis.client.Call;
  +import org.apache.axis.client.Service;
  +import org.apache.axis.client.Transport;
  +import org.apache.axis.encoding.XMLType;
  +import org.apache.axis.utils.Options;
   
  -import org.apache.axis.AxisFault ;
  -import org.apache.axis.Constants ;
  -import org.apache.axis.client.Call ;
  -import org.apache.axis.client.Service ;
  -import org.apache.axis.client.AxisClient ;
  -import org.apache.axis.client.Transport ;
  -
  -import org.apache.axis.utils.Options ;
  -import org.apache.axis.encoding.* ;
  -
  -/* Tests the simple File transport.  To run:
  +/** Tests the simple File transport.  To run:
    *      java org.apache.axis.utils.Admin client client_deploy.xml
    *      java org.apache.axis.utils.Admin server deploy.xml
    *      java samples.transport.FileTest IBM
  @@ -20,37 +14,37 @@
    */
   
   public class FileTest {
  -  public static void main(String args[]) throws Exception {
  -    FileReader  reader = new FileReader();
  -    reader.setDaemon(true);
  -    reader.start();
  -
  -    Options opts = new Options( args );
  -    
  -    args = opts.getRemainingArgs();
  -    
  -    if ( args == null ) {
  -      System.err.println( "Usage: GetQuote <symbol>" );
  -      System.exit(1);
  -    }
  -    
  -    String   symbol = args[0] ;
  -    Service  service = new Service();
  -    Call     call    = (Call) service.createCall();
  -    call.setOperationName( "getQuote" );
  -    call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
  -    call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
  -    call.setReturnType( XMLType.XSD_FLOAT );
  -    call.setTransport( new FileTransport() );
  -    call.setProperty(Transport.USER, opts.getUser() );
  -    call.setProperty(Transport.PASSWORD, opts.getPassword() );
  -    call.setProperty(Call.TIMEOUT, "10000");
  -  
  -    Float res = new Float(0.0F);
  -    res = (Float) call.invoke( new Object[] {symbol} );
  -  
  -    System.out.println( symbol + ": " + res );
  +    public static void main(String args[]) throws Exception {
  +        FileReader  reader = new FileReader();
  +        reader.setDaemon(true);
  +        reader.start();
  +
  +        Options opts = new Options( args );
  +
  +        args = opts.getRemainingArgs();
  +
  +        if ( args == null ) {
  +            System.err.println( "Usage: GetQuote <symbol>" );
  +            System.exit(1);
  +        }
  +
  +        String   symbol = args[0] ;
  +        Service  service = new Service();
  +        Call     call    = (Call) service.createCall();
  +        call.setOperationName( "getQuote" );
  +        call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
  +        call.setProperty( Call.NAMESPACE, "urn:xmltoday-delayed-quotes" );
  +        call.setReturnType( XMLType.XSD_FLOAT );
  +        call.setTransport( new FileTransport() );
  +        call.setProperty(Transport.USER, opts.getUser() );
  +        call.setProperty(Transport.PASSWORD, opts.getPassword() );
  +        call.setProperty(Call.TIMEOUT, "10000");
   
  -    reader.halt();
  -  }
  +        Float res = new Float(0.0F);
  +        res = (Float) call.invoke( new Object[] {symbol} );
  +
  +        System.out.println( symbol + ": " + res );
  +
  +        reader.halt();
  +    }
   }