Basic Calculator Client


Running the Sample

The Basic Calculator Client Sample communicates directly with the Stateless Session Beans EJB Version 1.1 Technology Sample on a WebSphere Application Server. Verify that this EJB Sample works correctly and that the application server starts and is correctly configured by running this Sample.

If the Technology Sample has not been installed on the application server then open a browser to the Application Server Samples Gallery (http://<host_name>:<port>/WSsamples/en/index.html) and install the Technology Sample which includes the Basic Calculator sample.

Running the Sample

The BasicCalculatorClient Sample is a command line application. You can run the Sample using the supplied batch file, the supplied script file, or manually using the command syntax below.

Getting started quickly:

To run the BasicCalculatorClient Sample using the supplied scripts, run the following commands:

  1. Open a command prompt.
  2. Change the current working directory to
  3. Run basicCalculator
  4. A successful run of the Sample on the Windows platforms follows:

    D:\WebSphere\AppClient\samples\bin\TechnologySamplesThinClient\BasicCalculator>basicCalculator
    --------------------------------------------------------------
    Running BasicCalculatorClientThinMain with parameters: add 1 2
    --------------------------------------------------------------
    
    --Creating InitialContext... Done.
    --Looking-up Home... Done.
    --Narrowing... Done.
    --Creating Home... Done.
    Result: 1+2 = 3
    Press any key to continue . . .
    	
Important Information If you would like to connect to a server or port other than the default, see Choosing a server.

Identifying the command syntax:

	<LAUNCHCOMMAND> <OPERATOR> <OPERAND> <OPERAND>
	<LAUNCHCOMMAND> ::= <Java Thin Application Client launch command>
	<OPERATOR> ::= add | subtract | multiply | divide
	<OPERAND> ::= <number>