axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/samples/stock GetInfo.java testit.cmd testit.sh
Date Fri, 19 Oct 2001 13:20:28 GMT
dug         01/10/19 06:20:27

  Modified:    java/samples/stock GetInfo.java testit.cmd testit.sh
  Log:
  Finish migrating the stock sample.
  
  Revision  Changes    Path
  1.13      +17 -9     xml-axis/java/samples/stock/GetInfo.java
  
  Index: GetInfo.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/GetInfo.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- GetInfo.java	2001/10/18 13:28:37	1.12
  +++ GetInfo.java	2001/10/19 13:20:27	1.13
  @@ -56,10 +56,13 @@
   package samples.stock ;
   
   import org.apache.axis.AxisFault;
  -import org.apache.axis.client.ServiceClient;
  +import org.apache.axis.client.Service;
  +import org.apache.axis.client.Call;
   import org.apache.axis.client.Transport;
   import org.apache.axis.transport.http.HTTPTransport;
  +import org.apache.axis.transport.http.HTTPConstants;
   import org.apache.axis.utils.Options;
  +import org.apache.axis.encoding.XMLType;
   
   /**
    *
  @@ -79,15 +82,20 @@
         }
   
         String  symbol = args[0] ;
  -      ServiceClient call = new ServiceClient
  -            (new HTTPTransport(opts.getURL(), "urn:cominfo"));
  +      Service  service = new Service();
  +      Call     call    = (Call) service.createCall();
   
  -      call.set( Transport.USER, opts.getUser() );
  -      call.set( Transport.PASSWORD, opts.getPassword() );
  -      String res = (String) call.invoke(
  -        "urn:cominfo", "getInfo",
  -        new Object[] { args[0], args[1] } );
  -      
  +      call.setTargetEndpointAddress( new java.net.URL(opts.getURL()) );
  +      call.setOperationName( "getInfo" );
  +      call.addParameter( "symbol", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
  +      call.addParameter( "info", XMLType.XSD_STRING, Call.PARAM_MODE_IN );
  +      call.setProperty( Call.NAMESPACE, "urn:cominfo" );
  +      call.setProperty( Transport.USER, opts.getUser() );
  +      call.setProperty( Transport.PASSWORD, opts.getPassword() );
  +      call.setProperty( HTTPConstants.MC_HTTP_SOAPACTION, "" );
  +
  +      String res = (String) call.invoke( new Object[] { args[0], args[1] } );
  +
         System.out.println( symbol + ": " + res );
       }
       catch( Exception e ) {
  
  
  
  1.12      +2 -1      xml-axis/java/samples/stock/testit.cmd
  
  Index: testit.cmd
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/testit.cmd,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- testit.cmd	2001/10/17 14:01:06	1.11
  +++ testit.cmd	2001/10/19 13:20:27	1.12
  @@ -6,9 +6,10 @@
   @echo Deploy everything first
   java org.apache.axis.client.AdminClient deploy.xml %*
   
  -@echo These next 2 should work...
  +@echo These next 3 should work...
   java samples.stock.GetQuote -uuser1 -wpass1 XXX %*
   java samples.stock.GetQuote -uuser2 XXX %*
  +java samples.stock.GetInfo -uuser3 -wpass3 IBM address
   
   @echo The rest of these should fail... (nicely of course)
   java samples.stock.GetQuote XXX %*
  
  
  
  1.10      +2 -1      xml-axis/java/samples/stock/testit.sh
  
  Index: testit.sh
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/stock/testit.sh,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- testit.sh	2001/10/15 19:24:00	1.9
  +++ testit.sh	2001/10/19 13:20:27	1.10
  @@ -4,9 +4,10 @@
   echo "Deploy everything first"
   java org.apache.axis.client.AdminClient deploy.xml $*
   
  -echo "These next 2 should work..."
  +echo "These next 3 should work..."
   java samples.stock.GetQuote -uuser1 -wpass1 XXX $*
   java samples.stock.GetQuote -uuser2 XXX $*
  +java samples.stock.GetInfo -uuser3 -wpass3 IBM address
   
   echo "The rest of these should fail... (nicely of course)"
   java samples.stock.GetQuote XXX $*
  
  
  

Mime
View raw message