| Sun Java System Application Server
|
Samples Index
The Order Processing Sample Application using Security with Trust
This is a little complex secure Web Service application. This sample
demonstrates, how to :
- Write a secure Webservice using Trust
- Compile and deploy the Webservice
- Write an Appclient that calls the Webservice
- connect and run the Webservice from the Appclient
Configuration
The build script is designed to be easily moved anywhere else and
modified. To keep things as simple as possible it is not
dependent on the
build framework in the Samples hierarchy.
You do, however, have to setup some variables for Ant. The easiest
way to do this is to add these variables to /build.properties
(they are populated with sample values)
javaee.home=/as9
javaee.server.name=localhost
javaee.server.port=8080
How to use the build script
- Start the App Server and make sure you have /build.properties
setup correctly.
- To do everything, simply run ant with no arguments
- ant server compiles and deploys the Webservice
- ant sts compiles and deploys the STS(Security Token
Service) service
- ant client Compiles the client
- ant run-client Runs the Appclient
Building, Deploying, and Running the Application in NetBeans IDE
Follow these instructions to build, deploy, and run
this sample application using NetBeans IDE.
- Refer to common build
instructions. for setting up NetBeans IDE and the application
server with which the IDE will use.
- Make usre that you have defined the appropriate values in
build.properties based on above common build instructions which is a
pre-requisite for this sample.
- In NetBeans IDE, select File->OpenProject and select
samples_install_dir/javaee5/webservices/orderprocessing-xwss-trust
as the project.
- Right click on
orderprocessing-xwss-trust and
select Run Project which will build, deploy and run the
project. Sample output is given below.
CASE 1 : seller sells 1000 items of item code 123 & buyes places an order for 500 item of item code 123.
Feedback : Seller's request is successfully completed !.
Total number of items is 1000 for the item code x123
Feedback : Buyer's request is successfully completed !
CASE 2 : buyes places an order for 600 item of item code 123
Feedback : No sufficient stock of reqested item !!
Request for 600 items but items available in stock : 500
run-client:
BUILD SUCCESSFUL (total time: 20 seconds)
For more details
- Refer to WSIT Tutorial (chapter 6 and 7) at https://wsit-docs.dev.java.net/releases/m4/index.html
- Refer to http://blog.sun.com/shyamrao
- Refer to http://blogs.sun.com/harsha/
- Refer to http://blogs.sun.com/trustjdg/