Using the java client library

Download the java client library and it's dependent library (jmdns.jar).

Initializing the client

Within your application you need to setup your client to find the CRS web service.

Statically assign the settings to the client tool

The following code will initialize the ClientConfigurationUtil:

ClientConfigurationFactory.createClientConfiguration(new HttpTransport(), new StaticServiceLocator());

When you want to run the application you must provide the following parameters:

  • crs.client.service.hostname

    This will tell the StaticServiceLocator the hostname to connect to.

  • crs.client.service.port

    This will tell the StaticServiceLocator the port to connect on.

  • crs.client.service.contextpath

    This will tell the StaticServiceLocator the contextpath to communicate with.

  • crs.client.configuration.name

    This will tell the client library what configuration file will be used.

Dynamically detect the settings

The following code will initialize the ClientConfigurationUtil:

ClientConfigurationFactory.createClientConfiguration(new HttpTransport(), new MDNSServiceLocator());

When you want to run the application you must provide the following parameters:

  • crs.client.configuration.name

    This will tell the client library what configuration file will be used.

Requesting a setting

String: ClientConfigurationUtil.getStringSetting("section", "setting")
Integer: ClientConfigurationUtil.getIntSetting("section", "setting")
...