axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cha...@apache.org
Subject svn commit: r471691 - /webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/README.txt
Date Mon, 06 Nov 2006 10:59:46 GMT
Author: chatra
Date: Mon Nov  6 02:59:45 2006
New Revision: 471691

URL: http://svn.apache.org/viewvc?view=rev&rev=471691
Log:
completed review

Modified:
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/README.txt

Modified: webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/README.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/README.txt?view=diff&rev=471691&r1=471690&r2=471691
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/README.txt (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/README.txt Mon Nov
 6 02:59:45 2006
@@ -1,101 +1,104 @@
-
+Sample: Service Life Cycle
+==========================
+
 Introduction
 ============
 
-This sample is to demonstrate usage of service life cycle interface and session scoping with
a
+This sample is to demonstrate usage of a service life cycle interface and session scoping
with a
 sample on application scope session.  The sample consists of two parts;
    Service and Client
 
 Let's take a library system, which has the following operations, as the scenario for this
sample.
 
- - register user
- - login to system
- - view all books
- - view available books
- - view lend books
- - and lend and return books
-
-Why Do We Need Service Life Cycle Here?
-================================================
+ - Register user
+ - Login to system
+ - View all books
+ - View available books
+ - View lend books
+ - Lend and return books
 
 
+Why Do We Need Service Life Cycle Here?
+=======================================
 
-Well, at the deployment time we need to initialize the service , reading stuff from somewhere
(??) ,
-so at the runtime service impl class access those  data. Forget about the session for a minute
,
-think about the scenario where you want to populate a bean or need to start a DB connection
for the
-service , in such situation having service life cycle class is very useful.
+In order to make sure that at the runtime service impl class can access data read from anywhere,

+we need to initialize the service at deployment. Let's forget about the session for a minute
+and think about the scenario where you want to populate a bean or need to start a Data Base
connection for the
+service. In such a situation having service life cycle class is very useful.
 
-In this sample you fill learn how to use the service life cycle class for your application.
The
+In this sample you will learn how to use the service life cycle class for your application.
The
 interface has only two methods
--startUp
--shutDown
+1. startUp
+2. shutDown
 
 Where startUp method will be called when the service is deployed and it will call only once
for that
- particular service , while shutDown method calls when system shutdown.
+particular service, while shutDown method calls when system shutdown.
+
+So in this sample, the life cycle class will load the library inside the startUp method.
At the
+very first time the system will load from services.xml. It has all the available books in
the
+system. And at the time of system shutdown it will save the status of the library into a
file
+(library.xml) in the java.io.temp directory. So the next time onwards it will populate library
+using the above file. So all the changes will be there in the new instance as well.
 
-So in this sample , the life cycle class will load up the library in side the startUp method.
At the
- very first time the system will load up from services.xml , it has all the available books
in the
- system. And at the time of system shutdown will save the status of the  library into a file
- (library.xml) in the java.io.temp directory. So the next time on wards it will populate
 library
- using the above file. So all the changes will be there in the  new instance as well.
-
-How to build the service ?
-=================================================
-Building the service is just a matter of running ant build file. It will create you the service
aar
-file , or you could just run the copy.to.tomcat goal , it will cope the aar file into
+
+How to Build the Service?
+==========================
+
+Building the service is just a matter of running ant build file. It will create the service
aar
+file, or you could just run the copy.to.tomcat goal which will copy the aar file into
 tomcat/web-app/axis2/WEB-INF/services directory.
 
-Next , go to  http://[url and port to your app server]/axis2 and see whether your service
is listed
+Next, go to  http://[url and port to your app server]/axis2 and see whether your service
is listed
 there.
 
-Running the client.
-=================================================
-WOW , you  can invoke complete service using REST API , but that only work in application
servers like tomcat and that will not work in SimpleHttpServer. First try to use library system
using REST
-API.
+Running the Client
+==================
+
+You  can invoke complete service using REST API, but it only works in application servers
like Apache Tomcat and it will not work in SimpleHttpServer. First try to use library system
using REST API.
 
-This sample is simple one and will not do complex tasks , so lets try to follow the right
way . 
-Step 1:- View all the available books in the library  , just type the following URL in your
favorite
+This sample is a simple one and will not do complex tasks. So let's follow steps given below
to make
+ sure that the sample works as it should:
+ 
+Step 1:- View all the available books in the library, just type the following URL on your
favorite
 browser.
-   http://127.0.0.1:8080/axis2/rest/Library/listAvailableBook
+http://127.0.0.1:8080/axis2/rest/Library/listAvailableBook
 
 You will see all the available books in the system
 
 Step 2 : View all the books in the system 
 http://127.0.0.1:8080/axis2/rest/Library/listAllBook
 
-In this case you will get exacatly the same result for both the request , since no one has
borrowed
+In this case you will get exactly the same result for both the request, since no one has
borrowed
 the book.
 
-Step 3: Now look at the all the lend books in the system . And you will see empty list;
+Step 3: Now look at all the lent books in the system. And you will see an empty list at
 http://127.0.0.1:8080/axis2/rest/Library/listLendBook
 
+Step 4 : Register a user. To lend a book or return a book, you need to register first. Do
not register twice, 
+if you try to do so you will get an exception.
 
-Step 4 : Register a user
-To lend a book or return a book , you need to register first. And do not register twice ,
if you
-tries do so you will get an exception.
-
-To register you need to give user name and password (have a look at the wsdl , you will see
what you
+To register you need to give user name and password (have a look at the wsdl at http://127.0.0.1:port/axis2/services/serviceName?wsdl.
You will see what you
  need to pass in)
 
-So let's create a user called �foo� with the password �123�
+So let's create a user called 'foo' with the password '123' 
 http://127.0.0.1:8080/axis2/rest/Library/register?userName=foo&passWord=123
 
-Then you will get the following response , if everything is gone well.
+Then you will get the following response, if everything has gone well.
 <ns:registerResponse>
      <ns:return>true</ns:return>
 </ns:registerResponse>
 
-Step 5 : Login to system , to login you need to pass user name and password. So let's try
to login
+Step 5 : Log into system. To log in you need to pass user name and password. So let's try
to login
 to system.
 http://127.0.0.1:8080/axis2/rest/Library/login?userName=foo&passWord=123
 
-Step 6  : Now we are ready to lend a book , so let's do that. To lend a book you need to
pass isbn
-and userName. So lets try to lend the book with isbn �0-937175-77-3�, your request
would look like
-below;
+Step 6  : Now we are ready to lend a book. To lend a book you need to pass isbn
+and userName. Let's try to lend the book with isbn  0-937175-77-3, your request would look
like
+below:
 
 http://127.0.0.1:8080/axis2/rest/Library/lendBook?isbn=0-937175-77-3&userName=foo
 
-If everything went well , you will see the following response in the browser.
+If everything went well, you will see the following response in the browser.
 
 <ns:lendBookResponse>
 	<ns:return>
@@ -105,7 +108,7 @@
           </ns:return>
 </ns:lendBookResponse> 
 
-Step 7 : Now go and look at  lend list again , http://127.0.0.1:8080/axis2/rest/Library/listLendBook
+Step 7 : Now go and look at lent list again at http://127.0.0.1:8080/axis2/rest/Library/listLendBook
 you will see the following output in the browser.
 
 <ns:listLendBookResponse>
@@ -116,28 +119,27 @@
           </ns:return>
 </ns:listLendBookResponse>
 
-Thats the book you just lend. 
+That's the book you just lent! 
 
-Note : Now if we view the available book , you will not see the above book in that list.
+Note : Now if we view the available books, you will not see the above book in that list.
 
-Step 8 : Now lets return the book.
+Step 8 : Now let's return the book.
 http://127.0.0.1:8080/axis2/rest/Library/returnBook?isbn= 0-937175-77-3 
 
-Step 8 : Now let's look at the lend book list again , and you will realize that list is empty.
-
-Step 9 : Lend few more book and re-start the app server (say tomcat) and see whether all
the data
-are there in the new instance.
+Step 8 : Now let's look at the lent book list again, and you will realize that list is empty.
 
+Step 9 : Lend few more book and re-start the app server (say Tomcat), and see whether all
the previous data
+is there in the new instance.
 
-Running Java client.
-==================================================
+Running Java Client
+===================
 Open up the LibraryServiceClient java class in your favorite IDE and run the main class.
And you can
- comment and un-comment what ever the method you want to invoke.
+ comment and un-comment whatever the method you want to invoke.
 
 
-Running Java client. Using Ant
-==================================================
+Running Java client Using Ant
+=============================
 invoke
 ant run.client
 
-And then follow the instruction as mentioned in the console
+And then follow the instructions as mentioned in the console.



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message