Fault fault = new Fault(new Exception("Exception message")); fault.setStatusCode(403); throw fault;
void throwFault(String message) { Fault fault = new Fault(new Exception(message)); fault.setFaultCode(new QName("Client")); fault.setStatusCode(ERROR_CODE); throw fault; } }
private Fault createFault() { Fault f = new Fault(new org.apache.cxf.common.i18n.Message("Server is suspended", LOG)); f.setStatusCode(503); return f; } }
@Override public void handleMessage(Message message) throws Fault { try { super.handleMessage(message); } catch (AccessDeniedException fault) { Fault unauthorized = new Fault("Unauthorized", getGlobal()); unauthorized.setStatusCode(403); throw unauthorized; } } }
@Override public void handleMessage(SoapMessage message) throws Fault { Fault f = (Fault) message.getContent(Exception.class); if (f == null) { return; } Throwable cause = f.getCause(); if (cause == null) { return; } f.setStatusCode(HTTP_OK_CODE); if (isClientException(cause)) { f.setFaultCode(new QName("Client")); } }
if(isAnnotated(method.getDeclaringClass().getAnnotations()) || isAnnotated(method.getAnnotations())) { final Fault fault = new Fault(new LoginException("Missing user id")); fault.setStatusCode(HttpServletResponse.SC_UNAUTHORIZED); throw fault;
if (verb != null && !"POST".equals(verb)) { Fault formula405 = new Fault("HTTP verb was not GET or POST", LOG); formula405.setStatusCode(405); throw formula405;
if (verb != null && !"POST".equals(verb)) { Fault formula405 = new Fault("HTTP verb was not GET or POST", LOG); formula405.setStatusCode(405); throw formula405;