//subscribe for the events
EndpointReference subscriptionEPR = subscribeForOperationalStatusChangeEvents(consumerUrl, m_resource);
//setup port listener
m_listener = new PortListen(80, 600000);
//call recalibrate (after noticing erratic behavior) on webservice to trigger the status change evennt
sendRecalibrateRequest(xepr);
//listen for operational change notif ...this will actually capture any message that comes in...
String messageText = m_listener.waitForIncomingMessage();
//upon notification.......dump to standard out for debugging
System.out.println(messageText);
try
{
//parse out the managementevent
ManagementEventTypeImpl manEvt = parseManagementEvent(messageText);
//here is the epr and the address of the source of the event....this is the weatherstation which caused the event.
EndpointReferenceType sourceEpr = parseSourceEpr(manEvt);
String sourceAddress = sourceEpr.getAddress().getStringValue();
//get the current operational status.....
String currentOperationalStatus = parseCurrentOperationalStatus(manEvt);
//try again to get the available message ...this was to debug their end....
m_listener = new PortListen(80, 600000);
String messageText2 = m_listener.waitForIncomingMessage();
}
catch (Exception e)
{
e.printStackTrace();