Universal Messaging 10.11 | Developer Guide | Enterprise APIs | Running the Sample Applications
 
Running the Sample Applications
Note: 
Universal Messaging pre-compiled sample applications are deprecated as of version 10.7. Note that the sample source code will remain available and can be used for reference when coding, but the compiled binaries will be removed from the product distribution in the next release.
Please use the Universal Messaging command line administration tools instead, as described in the section Command Line Administration Tools in the Administration Guide.
In order to make it easy for you to test the rich functionality provided by Universal Messaging, the Universal Messaging installation includes compiled versions of all the sample applications as well as native launchers that wrap them and use environment variables to minimize the input required by the user.
In preparation for running the sample applications, you need to open a command prompt at the operating system level, and type in appropriate commands to set up the environment for the sample applications, as described below.
Client Command Prompts on Windows
The client command prompt is a console/shell with environment variables set by a client environment script. Examples of such environment variables include RNAME, PATH, CLASSPATH, Certificate stores etc.
On Windows platforms, you can open a client command prompt using a shortcut in the Windows Start menu. The shortcut is Software AG > Tools > Universal Messaging Clients n.n > <InstanceName> > Universal Messaging Client Examples Command Prompt for <InstanceName> n.n, where <InstanceName> is the name of the Universal Messaging realm server instance, and n.n is the product version number.
If you want to run the Java, .NET or C++ sample applications that are delivered with the product, you need to set up the appropriate environment in the command prompt. To do this, proceed as follows:
Java
Run the command:
<InstallDir>/UniversalMessaging\java\<InstanceName>\bin\env.bat
This will set up all the environment configurations which are required to compile and run the Java samples.
Note:
You can run the Universal Messaging Tools Runner tool ("runUMTool") from the same command prompt as for the Java sample applications.
.NET (C#)
Run the command:
<InstallDir>/UniversalMessaging\java\<InstanceName>\bin\dotnetenv.bat
This will set up all the environment configurations which are required to compile and run the .NET (C#) samples. Additionally, it will redirect the command prompt location to the .NET examples.
C++
Run the command:
<InstallDir>/UniversalMessaging\java\<InstanceName>\bin\cplusenv.bat
This will set up all the environment configurations which are required to compile and run the C++ samples. Additionally, it will redirect the command prompt location to the C++ examples.
Note:
There are some further steps required to compile the C++ sample applications before running them. These steps are described in the section C++ Prerequisites.
Client Command Prompts on UNIX-based platforms
On UNIX-based platforms, you open a client command prompt by executing the appropriate softlink in the links folder under the install directory:
cd ~/<InstallDir>/UniversalMessaging_<version>/links/Client/umserver
where <version> is the product version number.
If you want to run the Java, .NET or C++ sample applications that are delivered with the product, you need to set up the appropriate environment in the command prompt. To do this, use one of the following commands:
*For Java:
./Java\ Examples\ Command\ Prompt
*For .NET:
./DotNet\ Examples\ Command\ Prompt
*For C++:
./C++\ Examples\ Command\ Prompt
As an alternative to using the above commands in UNIX-based platforms, you can set up the environment by using one of the following commands:
Java
Run the command:
<InstallDir>/UniversalMessaging/java/<InstanceName>/bin/env.sh
This command also redirects the command prompt location to the Java examples.
.NET (C#)
Run the command:
<InstallDir>/UniversalMessaging/java/<InstanceName>/bin/dotnetenv.sh
This command also redirects the command prompt location to the .NET examples.
C++
Run the command:
<InstallDir>/UniversalMessaging/java/<InstanceName>/bin/cplusenv.sh
This command also redirects the command prompt location to the C++ examples.
Note:
There are some further steps required to compile the C++ sample applications before running them. These steps are described in the section C++ Prerequisites.
Running the Java Sample Applications when Basic Authentication is Enabled
To use the Java sample applications on a Universal Messaging server on which basic authentication is enabled, you must configure one of the following system properties in the .conf file of the sample application:
*UM_PASSWORD=password. Passes the user password to the session used by the application.
*PASS_PASSWORD_IN_CONSOLE=true|false. Specifies whether to provide the user password in the console. The default value is false.
Important:
Do not use the two system properties together.
The Java sample applications are located in the Software AG_directory \UniversalMessaging\java\instance_name\bin directory. You configure the system properties in the configuration file of the sample application that you want to use by adding the following line:
wrapper.java.additional.n=-DUM_PASSWORD=password
or
wrapper.java.additional.n=-DPASS_PASSWORD_IN_CONSOLE=true|false
where n is the consecutive number of the system property and password is the user password.
Keep in mind that the system creates the session used by the sample application with the default username SampleApplication. You can change the username by configuring the UM_USERNAME property in the .conf file of the application.