Software Required for the Web Service - XML

Before starting the development of the Web service, ensure that the following software programs are installed on the machine:

  • Tomcat application server. You will be using Tomcat as the application server for most examples in this chapter.
  • IBM's Web Services ToolKit (WSTK). WSTK is not a commercial product; rather it's a collection of tools from IBM.
  • Websphere Studio Application Developer. Provided by IBM, this is a complete Java application environment for building, testing, and developing Java applications.
  • Axis SOAP kit.This is the latest SOAP toolkit from Apache. The latest version of the Axis SOAP kit is also bundled with WSTK.
  • Latest Java Development Kit (JDK).Most IBM tools, such as Tomcat and the WSTK, require JDK version 1.3 or above to be installed on your computer.

After you have downloaded the software from the specified Web sites, you can install them on your computer. The installation process is discussed in the following sections.

Installing Tomcat

Because you have already used Tomcat in the Java project, we will not discuss the installation of Tomcat in detail here. The installation of Tomcat is simple and straightforward. To install and run Tomcat, perform the following steps:

  1. Download the installation file from the specified URL.
  2. Run the executable file.
  3. Install Tomcat in the desired folder.
  4. Run the server by executing the batch file, startup.bat, from the Bin folder of your Tomcat installation.

Installing the WSTK

Installing the WSTK simply requires you to run the InstallShield Setup Wizard. To run it, perform the following steps:

  1. Run the InstallShield Setup Wizard. It shows the first page of the InstallShield Setup Wizard. Click on the Next button to proceed.
  2. The First Page of the InstallShield Setup Wizard

    The First Page of the InstallShield Setup Wizard

  3. Click on the Accept button in the License Agreement window to proceed with the installation, and click Next.
  4. The installation continues by specifying the install variables and options that you can set. In most cases, you need to accept the default settings for these variables.
  5. Set the path to the folder where you have installed JDK, as shown ,and click Next.
  6. Set the JAVA_HOME Path

    Set the JAVA_HOME Path

  7. Specify the location, as shown , where you want to install the WSTK. Then click Next.
  8. Specifying the Location for Installing the Web Services ToolKit

    Specifying the Location for Installing the Web Services ToolKit

  9. Select the type of installation, as shown in Figure, and click Next.
  10. Select the Installation Type

    Select the Installation Type

  11. Click on the Next button on all the following screens.
  12. The screen confirming the installation of the toolkit is displayed, as shown in Figure
  13. The End of Installation

    The End of Installation

Configuring the WSTK

The WSTK is designed to run as a plug-in within any standard Java application server that supports Java Servlet and JSP specifications. Before you use the WSTK, you need to configure your application server to use the toolkit. To do this, IBM provides you with a utility called the Web Services ToolKit Configuration Tool. This utility ships along with the WSTK.

The Web Services ToolKit Configuration Tool automates the configuration process for building services in the WebSphere, WebSphere MicroEdition, or Jakarta-Tomcat 4.0 environments. In addition, the tool allows you to specify the default UDDI registry that the WSTK will use to publish and locate the Web service.

To run the Web Services ToolKit Configuration Tool, perform the following steps:

  1. Use the following command to launch the Web Services ToolKit Configuration Tool:
  2. %WSTK_HOME%inwstkconfig.bat
  3. Running the toolkit presents a wizard-style GUI interface, as shown in Figure.

    Running the Web Services ToolKit Configuration Tool

    Running the Web Services ToolKit Configuration Tool

    As you can see, the wizard prompts you to specify the Web server that you need to use with the WSTK.

  4. Select the host name, port number, and location of the Web server.
  5. Note?/td>In this case, you would be using a Tomcat server. Therefore, specify the port number as 8080, the host name as localhost, and the location of the folder where you have installed Tomcat.

  6. Click on the Configure Services tab, as shown in Figure. The displayed window contains a list of all Web services files under the Services folder of the WSTK installation.
  7. The Configure Services Tab

    The Configure Services Tab

  8. Select the Web services you want to activate and click on the Next button.
  9. The third page of the tool allows you to configure options for the Web Service Inspection Language (WSIL) implementation, as shown in Figure
  10. Configuring WSIL

    Configuring WSIL

    Note?/td>WSIL is a new language that helps you discover Web services. You can use WSIL as an alternative to UDDI.

  11. Click on the Next button. The last page of the tool is displayed. This page allows you to select the UDDI registry that you want to use as a default registry for the Web Services ToolKit, as shown in Figure.
  12. Selecting the UDDI Registry

    Selecting the UDDI Registry

    Note?/td>The registry that you choose will be selected automatically each time you perform an UDDI-related operation within the WSTK. However, to select any other UDDI, you need to explicitly specify in the toolkit. To change the settings of the UDDI directory in the Configuration tool, use the following command:

    %WSTK_HOME%libwstkproperties.xml file
  13. Click on the Finish button to complete the configuration.
  14. The WSTK is now ready to use.

Installing the Axis SOAP Toolkit

You use the toolkits provided by various vendors for various products to reduce the time required to create the application. Similarly, to reduce the time taken to create the applications that involve SOAP messages, several toolkits, such as Microsoft SOAP Toolkit, the Apache SOAP toolkit, and the PocketSOAP toolkit, are available. Without the use of such toolkits, coding for SOAP messages would be tedious.

Apache SOAP toolkit, also called the Axis SOAP toolkit, was originally based on an IBM implementation. Apache rearchitectured the SOAP toolkit to allow easier usage and configuration. As a result, a new toolkit called Axis was created.

Features of the Axis SOAP Toolkit

The latest version of the Apache SOAP toolkit has the following features:

  • It supports SOAP 1.1, similar to its earlier version, Apache SOAP 2.2. The final release of Axis supports a few features of SOAP 1.2 and provides partial support for pluggable XML protocols.
  • It provides a simple and convenient method of transporting SOAP messages between requestor and provider applications over protocols, such as FTP, SMTP, and so on.
  • The toolkit aims to automatically generate the WSDL documents for creating the Web services. To do this, the latest version of the Axis toolkit provides a tool called the wsdl2java tool. You will learn about this tool in the section titled "Creating a Client Application by Using Axis Tools."

You can use the wsdl2java tool to create stubs and skeletons from WSDL documents and proxies for Java classes. You can further use these stubs and skeletons to easily and conveniently code for the client applications that access the corresponding Web service.

  • The latest version of the Apache SOAP toolkit is more efficient that its previous versions. This is mainly because Apache SOAP toolkit uses SAX instead of DOM.
  • The toolkit also provides support for deploying EJB as services.
  • In addition to the support for creating a Web service and a client application, the toolkit extends support for deploying a Web service. The toolkit also helps expose the Java classes in the form of services.
  • The toolkit provides interoperability with the SOAP implementations provided by Microsoft and its .NET services.

We will now continue the discussion on installing the Axis SOAP toolkit. To install the toolkit, perform the following steps:

  1. Unzip the contents of the Axis distribution that you have downloaded into a folder.
  2. Tip?/td>Ensure that the Tomcat server is up and running.

  3. Copy the Axis folder from AXIS_HOMEwebapps to TOMCAT_HOMEwebapps.
  4. Copy xerces.jar to the TOCMAT_HOMEwebappsaxisWEB-INFlib directory.
  5. Make the modification to the server.xml file in the TOMCAT_HOMEconf directory, as highlighted in the following code:
  6. Shut down Tomcat and then restart it. To shut down the server, you need to run the shutdown.bat file in the Bin folder under TOMCAT_HOME.

As discussed, you will use the Axis SOAP toolkit to create the Credit Card Web service. This Web service uses the Luhn discussed in the following section.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

XML Topics