I have a requirement to log the REST request and response messages, so I have used apache wing RequestHandler. And I am able to get the response using the ResponseHandler. But unable to get the Request details in Handler Class. Could you please help me on this?
public class RESTRequestHandler implements org.apache.wink.server.handlers.RequestHandler {
@Override
public void handleRequest(MessageContext context, HandlersChain handlerChain)
throws Throwable {
//Unable to fetch the request details..Issue is here
handlerChain.doChain(context);
}
}
public class RESTResponseHandler implements org.apache.wink.server.handlers.ResponseHandler {
@Override
public void handleResponse(MessageContext context, HandlersChain handlerChain)
throws Throwable {
//Able to get the response details using the below code
SampleResponseObject object=(SampleRespObject) context.getResponseEntity();
}
}