Web Services Testing with soapUI
上QQ阅读APP看书,第一时间看更新

Project pre-requisites

Before starting to implement the project, let's make the project environment ready.

Java

We are going to develop the sample project using Java. Therefore, make sure to install JDK1.6 or later version in your machine.

Apache Ant

We will be using Apache Ant to build our project. Of course, you may use any build tool you prefer.

You can download the latest version of Apache Ant from http://ant.apache.org/bindownload.cgi and follow the installation guide to set up Ant on your machine.

MySQL

MySQL will be used as the database management system in our sample project. All data used in sample hotel reservation system will be stored in a MySQL database. Therefore, we should set up MySQL in our machines. We can download MySQL from http://www.mysql.com/downloads/mysql/ and follow the instructions given in the installation guide to set it up on your machine.

Setting up Apache Axis2

There are numerous web service frameworks which can be used in web services development and deployment. Apache CXF (http://cxf.apache.org/) and Apache Axis2 (http://axis.apache.org/axis2/java/core/) are two examples of popular open source web service frameworks. The pure RESTful web service frameworks such as RESTeasy (https://www.jboss.org/resteasy/) can also be used in web services implementation.

We will use Apache Axis2 web services framework in our sample project because Apache Axis2 is primarily a SOAP based web services engine and our sample project is focused on a set of SOAP-based web services. Let's set up Axis2 on our machine according to the following steps:

  1. You can download the binary distribution of Apache Axis2 from http://axis.apache.org/axis2/java/core/download.cgi. Download the binary and extract it into a folder in your file system.

    Tip

    Apache Axis2-1.6.1 was the latest version at the time of writing the book. You may download the same or the latest version.

  2. Let the extracted folder of the Axis2 binary distribution be AXIS2_HOME. Open a command window or shell and change the directory to AXIS2_HOME/bin.
  3. Export the AXIS2_HOME environment variable as follows:

    In Linux:

    export AXIS2_HOME=/home/user/axis2-1.6.1

    In Windows:

          set AXIS2_HOME=/home/user/axis2-1.6.1
  4. Start Axis2 server by executing axis2server.sh or axis2server.bat as follows:
    sh axis2server.sh
    

Setting up project source directories

As of now, we have configured the Java runtime environment, Apache Ant, MySQL database management system, and Apache Axis2. Now, we are going to set up the source folder structure of our sample web services development project so that we can start adding code.

  1. Create a directory in your file system, let's name it as sample-project.
  2. Create the following sub-directories under the sample-project folder:
    • src: It is used to store the java source files
    • build: The ant build.xml file will be stored here
    • conf: It is used to store all configuration files