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

  1. Unzip the Push_Authentication_Sample\Registration-listener-sample.zip' file to the destination of your choice (for example, a Registration-listener-sample' folder).

  2. 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.

  3. Copy the config folder from the unzipped delivery to <SAMPLE_HOME>.

  4. Replace <REGISTRATION_LISTENER_HOME> in config/log4j.properties with <SAMPLE_HOME>.

  5. Deploy the 'ac-4tress-registration-listener-sample.war' application on your application server. The context root is “RegistrationListener”.

  6. 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:
    • REGISTRATION_LISTENER_HOME with your <SAMPLE_HOME> as the value.

    • 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 = <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:

Copy
{
"client_notification_token":"8d67dc78-7faa-4d41-aabd-67707b374255",
"domain": "ONLINEBANK",
"usercode": "myTestUser",
"deviceid": "11924"
}

See HTTP Callback Notifications Message Format.