How to Receive Event Notifications through ENS

Receiving Event Notifications

To receive event notifications, an HTTP (port 80) or HTTPS (port 443) listener service must be configured to receive XML formatted information. The following ports are available as well, ports 8080 or 11080 or 8443. The service needs to be configured to listen for the event notification messages coming from Kount and then be able to pull in and parse the data. The page that receives the notifications needs to read a raw POST.

To receive the raw POST, configure firewall settings to allow the following IP addresses: 

Sandbox

208.75.115.254 208.75.112.254

Production

208.75.115.253 208.75.112.253 209.81.12.251

The site can be configured to use different programming languages to pull in and parse the raw XML data. The following list presents example code snippets that can be used to perform this function, written in PHP, Java, C#.NET, VB.NET, and Perl:

PHP

<?php
  $xmlData = $HTTP_RAW_POST_DATA;
  // Parse XML...
?>

Java

...
BufferedReader is = new BufferedReader(new InputStreamReader(request.getInputStream()));
StringBuffer xmlData = new StringBuffer();
String buf = null;
while((buf = is.readLine())!= null){
  xmlData.append(buf);
}
// Parse XML...

C#.NET

protected void Page_Load(object sender, EventArgs e) {
    StreamReader reader = new StreamReader(Page.Request.InputStream);
    String xmlData = reader.ReadToEnd();
    // Parse XML...
}

VB.NET

Sub Page_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs)
    Dim reader As StreamReader = New StreamReader(Page.Request.InputStream)
    Dim xmlData As String = reader.ReadToEnd()
    // Parse XML...
End Sub

Perl

#!/usr/bin/perl
use CGI;
my $q = new CGI;
print $q->header;
my $xml = $q->param('POSTDATA');
# Parse XML ...
Was this article helpful?
1 out of 1 found this helpful