Registration-listener Sample
This sample is a small web application that is intended to be deployed on an application server.
The HTTP Registration Listener sample illustrates how messages are posted to the HTTP callback URL when a device registration succeeds.
It also illustrates how to get feedback on client side (in a web browser) using Ajax polling.
Install the Sample
-
Unzip the Push_Authentication_Sample\Registration-listener-sample.zip' file to the destination of your choice (for example, a Registration-listener-sample' folder).
-
On your system where you plan to deploy this sample web application, create a base folder for the sample configuration files.
For example, C:\sample\RegistrationListener on Microsoft Windows or /opt/ RegistrationListener on Linux, referred to as <SAMPLE_HOME> in the rest of this section.
-
Copy the config folder from the unzipped delivery to <SAMPLE_HOME>.
-
Replace <REGISTRATION_LISTENER_HOME> in config/log4j.properties with <SAMPLE_HOME>.
-
Deploy the 'ac-4tress-registration-listener-sample.war' application on your application server. The context root is “RegistrationListener”.
-
Define the configuration home for this sample:
- For a JBoss application server, in the JBoss administration console, under Configuration, go to System Properties and add the following property:
- For a WebSphere application server, in the WebSphere administration console, go to Application servers, server-ActivID, Process definition, select Java Virtual Machine, and then edit the Generic JVM arguments by adding the following:
REGISTRATION_LISTENER_HOME with your <SAMPLE_HOME> as the value.
REGISTRATION_LISTENER_HOME = <SAMPLE_HOME>
Run the registration-Listener Sample
As soon as the application is deployed, it starts listening on the following URL:
http://<server_name>:<server_port>/RegistrationListener/CB/status
The sample is accessible using one of the following URLs:
http://<server_name>:<server_port>/RegistrationListener/index.html
or
https://<server_name>:<server_port>/RegistrationListener
All the messages received on the callback URL are displayed in a text zone.
Messages already received can be erased by clicking the Clear.
The format of the messages received on the HTTP callback is:
{
"client_notification_token":"8d67dc78-7faa-4d41-aabd-67707b374255",
"domain": "ONLINEBANK",
"usercode": "myTestUser",
"deviceid": "11924"
}