Custom configuration can be useful, for example, when several users share one WSO2 SOA Enablement Server Server installation and all want to run WSO2 SOA Enablement Server clients.
WSO2 SOA Enablement Server clients are configured by the client's configuration file located at WASP_HOME/conf/clientconf.xml. Consider a situation where a user wants a special configuration for the client and needs to modify the content of this configuration file. The user must have permission to modify the file. Changing the file can cause problems for other users, if those changes unexpectedly affect other users' clients.
The section Client Package tells how to configure Web services on the client side by using client packages that are cached at the client's application directory app_classpath. Sharing this directory can cause problems similar to sharing the client's configuration file. In addition, the user must have permission to write to this directory.
The easiest way to solve the problems above is to configure WSO2 SOA Enablement Server separately for every user in the user's home directory. This means that client configuration files are specific to each user's client application directory. These directories are not shared between users.
The following instructions will guide you through creating such a configuration:
Create a WSO2 SOA Enablement Server Client directory in the user's home directory (on UNIX systems, for example, ~/server_java65).
Create a subdirectory called conf in this WSO2 SOA Enablement Server Client directory.
Copy the file conf/clientconf.xml from the WSO2 SOA Enablement Server distribution to the new conf subdirectory of the WSO2 SOA Enablement Server Client directory.
Now the user can run a client program with the wasp.location property set to the newly created WSO2 SOA Enablement Server Client directory. For details about system properties see the System Properties section.
The following steps show how to set your environment and run the MyClient class under UNIX-type systems (we assume that the MyClient class is located at the ~/myapp/classes directory):
Set the WASP_CLIENT_HOME variable to the created WSO2 SOA Enablement Server Client directory with the following command:
export WASP_CLIENT_HOME=~/server_java65
Set the CLASSPATH variable to the WASP_HOME/lib/wasp.jar and ~/myapp/classes, where WASP_HOME variable contains the WSO2 SOA Enablement Server location:
export CLASSPATH="$WASP_HOME"/lib/wasp.jar:~/myapp/classes
Run the client with wasp.location set to: WASP_CLIENT_HOME:
java -Dwasp.location="$WASP_CLIENT_HOME" MyClient
During initialization, WSO2 SOA Enablement Server goes through the following steps:
Reads system properties - Sets all WSO2 SOA Enablement Server system properties as initial arguments if they are not set already.
Reads default settings - Loads META-INF/wasp.properties resource from classpath, (lib/runner.jar in the WSO2 SOA Enablement Server distribution) and sets these properties as initial arguments if they are not set already.
Reads built-in settings - Sets initial arguments with its built-in default value if they are not set already.
Since the client is running with the system property wasp.location set, the default setting (from the WASP_HOME/lib/runner.jar file) is not used due to its lower priority.
It is possible to use WSO2 SOA Enablement Server for Java clients (that use clientconf.xml) without specifying the wasp.location system property. Place a JAR file containing either the conf directory or a directory containing conf as a subdirectory on the classpath. In both cases, the conf directory contains all neccessary WSO2 SOA Enablement Server client configuration files (from WASP_HOME/conf directory).