Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Table of Contents

This is the second example that demonstrates the ease of integrating security and reliable messaging to the WSO2 Application Server.

It demonstrates trading interactions between a stock exchange, trader (stock broker) and a client (shareholder). A shareholder who needs to buy and sell shares, should first become a client of that particular trader. A trader can register his client (the shareholder) in the stock exchange. Once registered, the shareholder uses his Central Depository System (CDS) account to buy and sell.

...

Note: Attributes of Stock Quote are name, symbol, selling price, high price and low price

 

Building the sample

The sample is located in in <AS_HOME>\Samples\Trader Trader  directory.

For more information, see  Building Axis2 Samples .

...

Info

If you do not see the services deployed, wait for a while for the deployment engine of Axis2 to pick up the newly added .aar and the refresh/reload the page.

Running the service

...

  1. From the terminal go to <AS_HOME>\samples\Trader directory.

  2. Execute one of the following commands to run the client:

    OSCommand
    MS Windowsrun-client.bat [ -qos (rm | secure | securerm)] [-te <TraderService URL>] [-ee <ExchangeService URL> ]
    Unix/Linuxrun-client.sh [ -qos (rm | secure | securerm)] [-te <TraderService URL>] [-ee <ExchangeService URL> ]

...

  • Login to the Application Server Management Console.
  • Add a user (under configure menu -> Users and Roles) named "test" with password "test123."Similarly, add a role "testrole" and add user "bob" to that role.
  • Similarly, add a role "testrole" and add user "test" to that role.
  • Provide all permissions for this role.
  • Then go to the "Deployed Services" window in the AS Management Console. (Manage > Service > List).
  • Access the dashboard of the service "TraderClient" service by clicking on it.
  • In the dashboard, under "Security," select "Username Token." Press "Next."
  • Then select "testrole" from the user groups listed.
  • Click "Finish."

Follow the same steps for ExchangeClient service. Then go to <AS_HOME>/samples/Trader directory and type: ./run-client.sh -qos secureYou secure . You would see a prompt asking for the username and password before listing the operations available as follows:

...