How to setup a WSAG4J client project

This is a step by step guide for new WSAG4J users. It describes the required steps to install the WSAG4J server application and set up an initial WSAG4J client project. Be aware that a WSAG4J client requires an active WSAG4J server in order to work. Here is a quick guide to install the WSAG4J server application used in this tutorial.

WSAG4J client project setup

Download the WSAG4J client distribution

WSAG4J ships with 2 distributions: the WSAG4J server distribution and the WSAG4J client distribution. Download and extract the WSAG4J client distribution.

Eclipse IDE project

This tutorial uses Eclipse as development environment to set up the WSAG4J client project. There are two alternatives to set up the WSAG4J client project: as Java Project or as Maven project. Both of them are described below.

Java Project
  1. Start the Eclipse IDE and create a new Java Project. Select File->New->Java Project from the Eclipse menu. This starts the Eclipse New Project Wizard. Type in a name for your project and press Finish.
  2. Add the WSAG4J configuration files. Create a new folder resources in your Java project. Copy all files from the classes folder of the WSAG4J client distribution to the resources folder. Right click the Java project and select Properties. Select Java Build Path->Libraries. Click Add Class Folder..., then select the resources folder and click OK.
  3. Add the WSAG4J libraries to the Java project. Right click the Java project and select Properties. Select Java Build Path->Libraries. Select "Add External JARs..." and open the lib folder of the WSAG4J client distribution. Select all jar archives and click OK.
Maven Project
  1. Ensure that your Eclipse IDE has the Maven plugin m2eclipse installed.
  2. Start the Eclipse IDE and create a new Maven Project. Select File->New->Project from the menu bar and select Maven->Maven Project. In the Maven Project wizard select create a simple project and click Next. Type in a group id and an artefact id and press Finish.
  3. Add the appropriate WSAG4J client to your project POM. Insert the following lines inside in order to add the Restful client implementation to your project:
      <dependencies>
        <dependency>
          <groupId>net.sf.wsag4j.rest</groupId>
          <artifactId>wsag4j-rest-client</artifactId>
          <version>2.0.0</version>
        </dependency>
      </dependencies>
    
  4. Insert the following lines inside in order to add the WSRF client implementation to your project:
      <dependencies>
        <dependency>
          <groupId>net.sf.wsag4j.wsrf</groupId>
          <artifactId>wsag4j-wsrf-client</artifactId>
          <version>2.0.0</version>
        </dependency>
      </dependencies>
    

    In case you use the WSRF version you need to add the PACKCS Maven Repository to your project.

            <repositories>
                    <repository>
                            <id>packcs</id>
                            <name>packcs release-repository</name>
                            <url>http://packcs-e0.scai.fraunhofer.de/archiva/repository/maven2</url>
                    </repository>
            </repositories>
    

Application Server Setup

This section describes how to install the WSAG4J web application into the Tomcat servlet engine.

  1. Download the Apache Tomcat and extract it into your home directory.
  2. Download the WSAG4J server distribution and extract it.
  3. Copy the wsag4j-(rest|wsrf)-webapp-2.0.0.war from your WSAG4J server distribution to the webapps folder of your Tomcat installation.
  4. Start Tomcat by calling the startup script from the bin directory of your Tomcat installation.

Open the URL http://127.0.0.1:8080/wsag4j-rest-webapp-2.0.0 for the REST server application in your web-browser, or for the WSRF server application the URL http://127.0.0.1:8080/wsag4j-wsrf-webapp-2.0.0 respectively. This should display the Welcome Page of the WSAG4J server application.