Online documentation - Websydian v6.0 |
Users Guide | Patterns Reference | WebsydianExpress | Search |
To start an Application Service on the Java platform, an Application Service Listener function should be generated and built in addition to the Websydian application. See Implementing an Application Service Listener for further details.
When the Websydian program files have been deployed at the server location, the property file of the Application Service Listener function should be configured. Per default, the file containing the settings for the entire application is named obXXXclient.properties where XXX is the CA Plex version (e.g. 500).
In addition to the standard entries, the following entries should be added as shown in the sample below:
HTML.WEBSYDIANSERVER_PORT = 8189 HTML.WEBSYDIANSERVER_IPADDR = 127.0.0.1 HTML.SERVICE_IPADDR = localhost HTML.SERVICE_PORT = 11001 HTML.SERVICE_NAME = ProTestJava HTML.AUTO_RECOVER = y HTML.SOCKET_TIME_OUT = 0 HTML.TIME_TO_LIVE = 360 HTML.WEBSYDIANSERVER_CONNECTION_TIMEOUT = 30 HTML.HTTP_BODY_ENCODING = ISO-8859-1
For a description of each parameter please refer to Application Service Options.
The Application Service is started by calling the Java virtual machine with the following command:
java -cp obrun.jar;WsydDwa21.jar;<App> ObRun.ObPanel.ObLaunch WDwaSvc Path=<path>
<path> refers to the location of the property file obXXXclient.properties
and WDwaSvc is the file name of the Application Service Listener function.
<App> is the location of the generated Websydian Application Java class
files, e.g. c:\MyProjects\WebsydianJavaApp\Gen.
Alternatively the entire application can be packed as a Jar file and then
<App> should contain the full path to the Jar file.
If ObRun.jar and WsydDwa21.jar is not in the current folder, then specify the full path to those files when executing the command.
Remember to start the Websydian Server before starting the new Application Service. Otherwise the Application Service will fail to start when attempting to connect to the Websydian Server.
To start multiple Application Services for the same Websydian application each instance of the Application Services must have its own obXXXclient.properties file. To do this create a separate folder for each Application Service and copy the obXXXclient.properties file to the folder. Then each Application Service can be started using the above command where only the Path parameter differs:
java -cp obrun.jar;WsydDwa21.jar ObRun.ObPanel.ObLaunch WdwaSvc Path=<path1>
java -cp obrun.jar;WsydDwa21.jar ObRun.ObPanel.ObLaunch WdwaSvc Path=<path2>
...
An alternative method is to add parameters to the Application Service as command-line arguments. The command line arguments are added after the path definition. Please consult the Plex documentation for details on how to add input parameters to a Plex function as command-line arguments.
The sequence of the command-line arguments are as follows:
<Websydian Server IP> <Websydian Server port> <Websydian Server encoding> <IP> <port> <Service name> <Time to live> <Service URL> <Socket time out> <Recover> <Encoding>
Parameter | Description |
---|---|
Websydian Server IP | IP address of the machine where the Websydian Server is started |
Websydian Server TCP | TCP port that the Websydian Server listens on |
Websydian Server encoding | Encoding used when communicating with the Websydian Server |
Websydian Server connection | Time in seconds Application Service will wait before reconnecting to the Websydian Server |
IP | IP address of the Application Service Listener |
Port | TCP port used by the Application Service Listener |
Service name | Application Service Name |
Time to live | Token time to live |
Service URL | Alternative to the IP, Port, and Service name parameters. The syntax is "wsydwa://<IP>:<Port>/Service name" |
Socket time out | Time out on the socket connections |
Recover | Automatic recovery from minor errors (Y or N) |
Encoding | Encoding used for clients communicating with the Application Service |
Default character set | Default character set to use for requests/responses if the request/response is not associated with a character set. |
Command-line parameters must be specified in the above sequence. If some of the trailing arguments are omitted the corresponding values will be read from the property file.
Example:
java -cp obrun.jar;WsydDwa21.jar ObRun.ObPanel.ObLaunch WdwaSvc Path=<path1> 127.0.0.1,8189," ",30,"<default>",11001,myApp,0," ",0,Y," ", "ISO-8859-1" ,[Environment]
The [Environment] indicate the environment to be used default is "Default" - See the Plex manual for further information.
The sequence " " is used to send a blank value (*Blank ).
In some Plex versions there is a bug in the Plex java run time so it is not possible to send input parameters as command-line arguments. This should have been fixed in Plex 5.1.