Flylib.com

Books Software

 
 
 

Applied Software Engineering Using Apache Jakarta Commons (Charles River Media Computer Engineering) - page 84


Summary

Web Services are an interesting new technology that is used to process XML documents and perform XML RPC techniques. Using Web Services makes it possible to build a more sophisticated distributed processing architecture that can cope with the old and the new techniques. This chapter is only the beginning; you are strongly urged to read more information about Web Services and what they offer.

Wow! You have almost made it to the end of this book. This means you have digested all of the software engineering principles and programming techniques presented. It also means that our discussion of Axis ends our discussion of programming.

On the CD The sources to the concepts presented in this chapter are located under the directories [CDROM]/jseng/src/com.devspace.jseng.ws.file, [CDROM]/jseng/src/com.devspace.jseng.ws.msg, [CDROM]/jseng/src/com.devspace. jseng .ws.simple, and [CDROM]/jseng/src/com.devspace.jseng. ws.store. To be able to run the programs the Tomcat server has to be installed ([CDROM]/ downloads/tomcat-4.1.24.tar.gz) , and the Axis toolkit ([CDROM]/downloads/axis-1.1.tar.gz) has to be added to the Tomcat installation as a Web Application. To make things simple with respect to the installation of Axis, the directory [CDROM]/axis represents a fully functional Web Application.



Questions

10.1: Define a WSDL file that corresponds to the same method and parameter signature as the calculator extensions defined in previous questions. The trick in this question is that not only should the extension be defined, but a mechanism of connecting to a specific Web Service extension implementation also has to be defined. Consider this extra trick as being some type of factory method for Web Services. The objective of the WSDL definition is to be able to use the Web Service as if it were a calculator, where a properly programmed client could assemble and execute the questions dynamically, like the calculator application currently can. The difference is that a network exists between the consumer and implementation.

10.2: Implement the WSDL file defined in question 10.1. For the time being, keep the different operations simple, like adding and subtracting.

10.3: Generate the client stubs of the WSDL file defined in question 10.1. Of all questions in the entire book, this is the trickiest. If the WSDL is properly defined, then the generated stubs should be identical to the extensions defined in the calculator application. The objective of this question is to structure the calculator application such that whenever a calculation is to be performed, the extension is dynamically retrieved.

The application will have a configuration, batch file processing, etc., that stays the same. What changes is how the implementation of the calculator operation is executed. In this question, the implementation could be local, it could be a library that needs to be defined remotely, or it could be based on a Web Service defined remotely. In the configuration file, the ability to define a factory for other Web Services is then dynamically assigned.

It is important that you spend some time designing this part of the application because after this step, your calculator will be complete and should be fully operational. Then, in the implementation, anybody could use your WSDL file to define and integrate their Web Service.

10.4 (Optional) If these exercises are part of a bigger group effort, then exchange WSDL files and attempt to use other Web Service implementations . The key here is not to update your WSDL file, but rather figure out a strategy of how to integrate, which may or may not include updating the WSDL file.