Process and SOAP message
String target = messageContext.getTargetService();
// Check for null target
if (target == null) {
target = "";
}
// Get id, type and content
Long id;
Integer type;
Message message;
if (!messageContext.getPastPivot()) {
id = assignMessageId(messageContext);
type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_REQUEST);
message = messageContext.getRequestMessage();
} else {
id = getMessageId(messageContext);
type = new Integer(SOAPMonitorConstants.SOAP_MONITOR_RESPONSE);
message = messageContext.getResponseMessage();
}
// Get the SOAP portion of the message
String soap = null;
if (message != null) {
soap = ((SOAPPart)message.getSOAPPart()).getAsString();
}
// If we have an id and a SOAP portion, then send the
// message to the SOAP monitor service
if ((id != null) && (soap != null)) {
SOAPMonitorService.publishMessage(id,type,target,soap);
}