|
 |
|
|
|
|
|
|
|
|
|
|
Description
Project 4 Due: April 30, 2008
PART I In this project, you will get a hands-on experience with SOAP based distributed objects. You will use JAX-WS, the SOAP-based equivalent to Java RMI. JAX-WS replaces JAX-RPC, and the need to deal with direct SOAP code. JAX-WS will generate the required stub files to enable your standalone application to turn into a web service that can be accessed through a container such as Tomcat. You will create a simple FileSearch, as follows: - The FileSearch server will accept as argument ONE keyword and ONE file name. - It will take the keyword argument and look for it in the file given, and return the number of occurrences of that word. - Do not worry about options here. Just assume the default of partial and not case sensitive search.
Your client program can either ask for the input from the user, or just assume that the keyword and the file name are in a file called “filesearchinput” located in the same folder as the client file. Your “filesearchinput” file would look like something like this: test Myfile.txt
Where, “test” is the keyword and “Myfile.txt” is the file in which the server will look for the word.
For a step-by-step instructions on how to do this, go to:
http://www.devx.com/Java/Article/30459/1954
Make sure you follow the directions exactly as specified. First work with the example outlined in the article so you have an idea of what is going on. Try to understand the role of WSDL, the build files, etc… Then follow the steps to change it to your FileSearch application.
One thing that you must make sure you do: go to “Control Panel”, “System”, “Advanced System Settings”, “Environment Variables”. Then create a “JAVA_HOME” variable and set it to your JDK folder. For example, I have my Java 5 installed in C:\Java\jdk1.5.0_14, so I set JAVA_HOME to C:\Java\jdk1.5.0_14
The site above gives you the instructions on what has to be done. It includes the changes you need to do to a “build.xml” file located in the example folder. Just as reference, this is how my build.xml looks like (the first few lines):
You do not need to change anything else, only these three values, so that it matches your system.
There is also an alternative site, where you can use NetBeans IDE to build your server and client: http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/
What to submit: - A short documentation on what has to be done to run your application - The zipped folder for your application (this will have the same structure as the “SimpleExample” folder that you will have after downloading the example application from http://www.devx.com/Java/Article/30459/1954 -
PART II
The purpose of this part of the project is to give a taste of Java Security features. You won’t have to develop anything major here. Instead, you will work on the examples given in the book, just with minor modifications. Here we go:
1- Encryption: For your FileSearch example, modify the code so that the keyword is encrypted when sent to the search method, decrypted in the search method. Once the search is done, encrypt the result of the search and return the encrypted value. The main program should then decrypt the received value and display it to the user. Make sure you use two different encryption algorithms (one for encrypting the keyword, and one for encrypting the result – choose one symmetric and one public key cipher).
Submit one zip file with all your code/answers for Part I and Part II.
Reminder
You may not start working in this and any project before
your bid is accepted. Any user who violates this policy
may have their account permanently suspended.
|