Invoke the filter.
WebServiceEndpointStatsProviderImpl impl = (
WebServiceEndpointStatsProviderImpl) StatsProviderManager.
getInstance().getEndpointStatsProvider(endpoint);
if ( stage.equals(Filter.PRE_PROCESS_REQUEST) ) {
impl.setRequestTimeStamp( System.currentTimeMillis(),null, null, 0);
} else {
if ( stage.equals(Filter.POST_PROCESS_RESPONSE) ) {
SOAPMessageContext smc = context.getMessageContext();
SOAPMessage sm = null;
SOAPFault fault = null;
try {
if (smc != null)
sm = smc.getMessage();
if (sm != null) {
SOAPBody sb = sm.getSOAPBody();
if (sb != null) {
fault = sb.getFault();
}
}
} catch ( Exception e) {
// if body can not be obtained, consider this as failure
// (fault) case, however fault information is not available
impl.setFault(0,
System.currentTimeMillis(), context.getExecutionTime(), null,null, null);
return;
}
if ( fault == null) {
impl.setSuccess(0, System.currentTimeMillis(),
context.getExecutionTime());
} else {
impl.setFault(0,
System.currentTimeMillis(),context.getExecutionTime(),
fault.getFaultCode(), fault.getFaultString(),
fault.getFaultString() );
}
} else {
throw new RuntimeException(" Should not be called for this stage of execution of web service end point " + endpoint);
}
}