AP Web Services provide a means of accessing AP resources from external computers inside or outside of your company network using web HTTP methods and XML formatted requests and responses. The simplest way of deploying, configuring, and using AP Web Services is by using the handy command-line tool. Using this tool, there is no need to bother with coding a custom Java application to deploy AP Web Services.
In this Tuesday Tip, I will show you how to deploy and configure the AP Web Services command-line tool to send a message to a defined AP 3270 session.
STEPS ON SERVER
Open the Configuration Manager GUI application Expert Interface -> Infrastructure -> Web Services and enable notification and/or automation. You should also enable the audit logs for your web services so that you have a record of activity. Please leave the port number as the default value as this is the port web services will use to communicate with the local Tomcat server – this does not need to be accessible from the outside network. Automation Point provides sufficient default values for the rest of the options, so no need to change these.
Next you want to enable remote viewing on the server and possibly remote user login security. In this example, we are not enabling any security for web services/remote viewing.
STEPS ON CLIENT
The first thing you need to do is install a Java (JRE) on the remote client computer before using the RequestService command-line tool.
To deploy the RequestService client to your remote client computer:
- Copy the following file from the CA Automation Point server to your remote client computer.
%AP_HOME%\Sample\websvc\RequestServiceClientDist.zip
- Unzip the file into a directory of your choice.
Suppose you unzip RequestService into the root of your C:\ drive on the client machine (your laptop perhaps)….
In folder C:\RequestService\sample\websvc\scripts we modified member initSamples.bat as follows:
Set uriRoot=http://<DNS HOST NAME OR IP ADDRESS OF YOUR SERVER> :8080/apwebsvc
- e.g. Set uriRoot=http://APPSRVR: 8080/apwebsvc
In folder scripts we modified member sessionCredentials.txt as follows:
user=<userid>
password=<password>
These correspond to the User Account and password specified in the Configuration Manager -> Expert Interface –> Automation -> Remote Viewing.
The user and password above are credentials of a domain account on the AP Server.
From a CMD prompt I issue a Change Directory (CD) command to start in path
C:\RequestService\ sample\websvc\scripts and I issue:
SendMsgToSession
When prompted I input CA11 for the session name
When prompted I input “TEST this message is not encrypted” for the message to send
The following XML response appears indicating success:
You can confirm that this message was sent to the console by looking at the host log or viewing the audit log on the server:
Message was edited by: Stephen W. Slaughter