HTTP Events

 

ISL Online products send notifications when certain events occur. You can use these events for various purposes, e.g. save certain data to your database, respond to certain events through the XMLMSG interface etc.

Each HTTP event notification consists of the following parameters:

  • TIMESTAMP (event creation timestamp in unix timestmp format (unsigned long long))
  • MODULE (module name which created event - e.g. for ISL Light events it will be ISL_LIGHT)
  • EVENT (event name)
  • SERVERID (GRID ID number of server who created and sent event)
  • DOMAIN_ID (id of ISL domain where event originated)


Note: Depending on the event type, there are additional parameters present. Please refer to the specific ISL Product's manual for information on parameters that are available for the events triggered by that product.


You will probably write a PHP / ASP / ASP.NET script that will parse the POST values of HTTP notifications and act accordingly.

To access a filed in the POST part of the HTTP request, you would use something like this:

  • in PHP:
 $isl_module = $_POST["MODULE"];
  • in ASP / ASP.NET:
 isl_module = Request.Form("MODULE")

Your script should respond appropriately. If you set Global HTTP events strict error checking to Yes, it is mandatory to respond with valid XML content.

If you do not wish to send a message to the XMLMSG interface after a certain event, respond like this:

  • in PHP:
 echo "<nomessage/>";
  • in ASP / ASP.NET:
 Response.Write("<nomessage/>")

If you put these two parts together, a simple example script is ready for use:

  • in PHP:
 <?php

 if ("ISL_LIGHT" == $_POST["MODULE"]) {

 // do something ... write to your database, to a certain file, send an e-mail, ....

 }

 echo "<nomessage/>";

 ?>
  • in ASP / ASP.NET:
 <%

 if Request.Form("MODULE") = "ISL_LIGHT" then

 ' do something ... write to your database, to a certain file, send an e-mail, ....

 end if

 Response.Write("<nomessage/>")

 %>

Here is a simple PHP script that writes events to a file (/tmp/ISL_test_log.txt):

 <?php

 $myFile = "/tmp/ISL_test_log.txt";

 $fh = fopen($myFile, 'a');

 fwrite($fh, "---BEGIN---\n");

 $array = $_POST;

 $thestring = "";

 foreach($array as $key => $value) {

         $thestring .= "key: ".$key." - value: ".$value."\n";

 }

 fwrite($fh, $thestring);

 fwrite($fh, "---END---\n");

 fclose($fh);

 echo "<nomessage/>";

 ?>
Tags: isl conference proxy, integration

Was this article helpful?