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
- 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.
- 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.
- 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
- Ensure that your Eclipse IDE has the Maven plugin m2eclipse installed.
- 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.
- Add the WSAG4J Repository to the project POM. Insert the following lines inside the project tag of your project POM:
<repositories>
<repository>
<id>wsag4j-releases</id>
<name>WSAG4J Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>wsag4j-external</id>
<name>WSAG4J External Dependencies Repository</name>
<url></url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>wsag4j</groupId>
<artifactId>wsag4j-client</artifactId>
<version>1.0.3</version>
</dependency>
</dependencies>
- Copy all configuration files from the classes folder of the WSAG4J client distribution into the src/main/resources folder of your Maven project.
This section describes how to install the WSAG4J web application into the Tomcat servlet engine.
- Download the Apache Tomcat and extract it into your home directory.
- Download the WSAG4J server distribution and extract it.
- Copy the wsag4j-agreement-factory-1.0.3.war from your WSAG4J server installation to the webapps folder of your Tomcat installation.
- Start Tomcat by calling the start script from the subfolder named bin of your Tomcat installation.
Opening the URL http://127.0.0.1:8080/wsag4j-agreement-factory-1.0.3 in a Web-Browser. This should display the Welcome Page of the WSAG4J server application.