void throwFault(String message) { Fault fault = new Fault(new Exception(message)); fault.setFaultCode(new QName("Client")); fault.setStatusCode(ERROR_CODE); throw fault; } }
/** * TODO This is SOAP specific code and should not be in cxf core * @param fault */ private void enrichFault(Fault fault) { if (fault.getCause().getCause() instanceof IOException || fault.getCause() instanceof IOException) { String soap11NS = "http://schemas.xmlsoap.org/soap/envelope/"; String soap12NS = "http://www.w3.org/2003/05/soap-envelope"; QName faultCode = fault.getFaultCode(); //for SoapFault, if it's underlying cause is IOException, //it means something like server is down or can't create //connection, according to soap spec we should set fault as //Server Fault if (faultCode.getNamespaceURI().equals( soap11NS) && faultCode.getLocalPart().equals("Client")) { faultCode = new QName(soap11NS, "Server"); fault.setFaultCode(faultCode); } if (faultCode.getNamespaceURI().equals( soap12NS) && faultCode.getLocalPart().equals("Sender")) { faultCode = new QName(soap12NS, "Receiver"); fault.setFaultCode(faultCode); } } }
/** * TODO This is SOAP specific code and should not be in cxf core * @param fault */ private void enrichFault(Fault fault) { if (fault.getCause().getCause() instanceof IOException || fault.getCause() instanceof IOException) { String soap11NS = "http://schemas.xmlsoap.org/soap/envelope/"; String soap12NS = "http://www.w3.org/2003/05/soap-envelope"; QName faultCode = fault.getFaultCode(); //for SoapFault, if it's underlying cause is IOException, //it means something like server is down or can't create //connection, according to soap spec we should set fault as //Server Fault if (faultCode.getNamespaceURI().equals( soap11NS) && "Client".equals(faultCode.getLocalPart())) { faultCode = new QName(soap11NS, "Server"); fault.setFaultCode(faultCode); } if (faultCode.getNamespaceURI().equals( soap12NS) && "Sender".equals(faultCode.getLocalPart())) { faultCode = new QName(soap12NS, "Receiver"); fault.setFaultCode(faultCode); } } }
/** * TODO This is SOAP specific code and should not be in cxf core * @param fault */ private void enrichFault(Fault fault) { if (fault.getCause().getCause() instanceof IOException || fault.getCause() instanceof IOException) { String soap11NS = "http://schemas.xmlsoap.org/soap/envelope/"; String soap12NS = "http://www.w3.org/2003/05/soap-envelope"; QName faultCode = fault.getFaultCode(); //for SoapFault, if it's underlying cause is IOException, //it means something like server is down or can't create //connection, according to soap spec we should set fault as //Server Fault if (faultCode.getNamespaceURI().equals( soap11NS) && "Client".equals(faultCode.getLocalPart())) { faultCode = new QName(soap11NS, "Server"); fault.setFaultCode(faultCode); } if (faultCode.getNamespaceURI().equals( soap12NS) && "Sender".equals(faultCode.getLocalPart())) { faultCode = new QName(soap12NS, "Receiver"); fault.setFaultCode(faultCode); } } }
/** * TODO This is SOAP specific code and should not be in cxf core * @param fault */ private void enrichFault(Fault fault) { if (fault.getCause().getCause() instanceof IOException || fault.getCause() instanceof IOException) { String soap11NS = "http://schemas.xmlsoap.org/soap/envelope/"; String soap12NS = "http://www.w3.org/2003/05/soap-envelope"; QName faultCode = fault.getFaultCode(); //for SoapFault, if it's underlying cause is IOException, //it means something like server is down or can't create //connection, according to soap spec we should set fault as //Server Fault if (faultCode.getNamespaceURI().equals( soap11NS) && faultCode.getLocalPart().equals("Client")) { faultCode = new QName(soap11NS, "Server"); fault.setFaultCode(faultCode); } if (faultCode.getNamespaceURI().equals( soap12NS) && faultCode.getLocalPart().equals("Sender")) { faultCode = new QName(soap12NS, "Receiver"); fault.setFaultCode(faultCode); } } }
@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")); } }
f.setFaultCode(Fault.FAULT_CODE_CLIENT);
fc = v.getReceiver(); f.setFaultCode(fc);
fc = v.getReceiver(); f.setFaultCode(fc);
f.setFaultCode((QName) exchange .getProperty("faultcode")); f.setFaultCode((QName) exchange .getProperty("faultcode"));
throw new Fault("A required header representing a Message Addressing Property " + "is not present", LOG) .setFaultCode(new QName("http://www.w3.org/2005/08/addressing", "MessageAddressingHeaderRequired"));
throw new Fault("A required header representing a Message Addressing Property " + "is not present", LOG) .setFaultCode(new QName("http://www.w3.org/2005/08/addressing", "MessageAddressingHeaderRequired"));
} catch (Fault f) { if (!isRequestor(message)) { f.setFaultCode(Fault.FAULT_CODE_CLIENT);
} catch (Fault f) { if (!isRequestor(message)) { f.setFaultCode(Fault.FAULT_CODE_CLIENT);
} catch (Fault fault) { if (!isRequestor(message)) { fault.setFaultCode(Fault.FAULT_CODE_CLIENT);
} catch (Fault fault) { if (!isRequestor(message)) { fault.setFaultCode(Fault.FAULT_CODE_CLIENT);
} catch (Fault fault) { if (!isRequestor(message)) { fault.setFaultCode(Fault.FAULT_CODE_CLIENT);
} catch (Fault f) { if (!isRequestor(message)) { f.setFaultCode(Fault.FAULT_CODE_CLIENT);
f.setFaultCode(Fault.FAULT_CODE_CLIENT);
f.setFaultCode(Fault.FAULT_CODE_CLIENT);