Is there any way or API to return custom HTTP response from RESTful services using AXIS. All I want is to return custom http response such as 400 or 401 to client.
If still open... Here is the code about how the get the HTTPServletResponse object and set Status
MessageContext responseMessageContext =
MessageContext.getCurrentMessageContext();
HttpServletResponse resp =
(HttpServletResponse) responseMessageContext.getProperty(
org.apache.axis2.transport.http.HTTPConstants.MC_HTTP_SERVLETRESPONSE);
resp.setStatus(422);
Hope useful