soapFault.setFaultString(((SoapFault)ex).getReason()); } else { soapFault.setFaultString(((SoapFault)ex).getReason(), stringToLocale(((SoapFault)ex).getLang())); String msg = ex.getMessage(); if (msg != null) { soapFault.setFaultString(msg);
soapFault.setFaultString(sf.getFault().getFaultString()); SAAJUtils.setFaultCode(soapFault, sf.getFault().getFaultCodeAsQName()); soapFault.setFaultActor(sf.getFault().getFaultActor()); soapFault.setFaultString(sf.getReason()); SAAJUtils.setFaultCode(soapFault, sf.getFaultCode()); if (sf.hasDetails()) { SAAJUtils.setFaultCode(soapFault, new QName("http://cxf.apache.org/faultcode", "HandlerFault")); soapFault.setFaultString(exception.getMessage());
soapFault.setFaultString(sf.getFault().getFaultString()); SAAJUtils.setFaultCode(soapFault, sf.getFault().getFaultCodeAsQName()); soapFault.setFaultActor(sf.getFault().getFaultActor()); SoapFault sf = SoapFault.createFault((Fault)exception, message .getVersion()); soapFault.setFaultString(sf.getReason()); SAAJUtils.setFaultCode(soapFault, sf.getFaultCode()); if (sf.hasDetails()) { soapFault.setFaultString(exception.getMessage()); SAAJUtils.setFaultCode(soapFault, new QName("http://cxf.apache.org/faultcode", "HandleFault"));
@Override public SOAPFault addFault( QName faultCode, String faultString, Locale locale) throws SOAPException { SOAPFault fault = addFault(); fault.setFaultCode(faultCode); fault.setFaultString(faultString, locale); return fault; }
@Override public SOAPFault addFault(QName faultCode, String faultString) throws SOAPException { SOAPFault fault = addFault(); fault.setFaultCode(faultCode); fault.setFaultString(faultString); return fault; }
private SOAPFaultException createSOAPFaultException(String faultString) { SOAPFault soapFault; try { SOAPFactory soapFactory = SOAPFactory.newInstance(); soapFault = soapFactory.createFault(); soapFault.setFaultString(faultString); } catch (SOAPException e) { throw new RuntimeException("SOAP error"); } return new SOAPFaultException(soapFault); }
//Build the SOAP Fault Response MessageFactory factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); SOAPMessage response = factory.createMessage(); SOAPFault fault = response.getSOAPBody().addFault(); fault.setFaultString(myCustomErrorString); fault.addDetail().addChildElement("exception").addTextNode(myCustomErrorId);
private void throwUnsupportedOperation(String string) { try { SOAPFault fault = SAAJFactoryResolver.createSOAPFactory(null).createFault(); fault.setFaultString("Unsupported operation " + string); throw new SOAPFaultException(fault); } catch (SOAPException e) { throw new Fault(e); } }
private void throwUnsupportedOperation(String string) { try { SOAPFault fault = SAAJFactoryResolver.createSOAPFactory(null).createFault(); fault.setFaultString("Unsupported operation " + string); throw new SOAPFaultException(fault); } catch (SOAPException e) { throw new Fault(e); } }
public static SOAPFaultException createSOAPFaultEx(SOAPFactory soapFactory, QName faultCode, String message) { SOAPFault sf = null; try { sf = soapFactory.createFault(); sf.setFaultCode(faultCode); sf.setFaultString(message); } catch (SOAPException se) { se.printStackTrace(); } return new SOAPFaultException(sf); }
private SOAPFaultException createDuplicateHeaderException() { try { SOAPFault fault = soapVersion.getSOAPFactory().createFault(); fault.setFaultCode(soapVersion.faultCodeClient); fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName)); return new SOAPFaultException(fault); } catch(SOAPException e) { throw new WebServiceException(e); } }
private SOAPFaultException createDuplicateHeaderException() { try { SOAPFault fault = soapVersion.getSOAPFactory().createFault(); fault.setFaultCode(soapVersion.faultCodeServer); fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName)); return new SOAPFaultException(fault); } catch(SOAPException e) { throw new WebServiceException(e); } }
private SOAPFaultException createDuplicateHeaderException() { try { SOAPFault fault = soapVersion.getSOAPFactory().createFault(); fault.setFaultCode(soapVersion.faultCodeClient); fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName)); return new SOAPFaultException(fault); } catch(SOAPException e) { throw new WebServiceException(e); } }
private SOAPFaultException createDuplicateHeaderException() { try { SOAPFault fault = soapVersion.getSOAPFactory().createFault(); fault.setFaultCode(soapVersion.faultCodeServer); fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName)); return new SOAPFaultException(fault); } catch(SOAPException e) { throw new WebServiceException(e); } }
private SOAPFaultException createDuplicateHeaderException() { try { SOAPFault fault = soapVersion.getSOAPFactory().createFault(); fault.setFaultCode(soapVersion.faultCodeClient); fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName)); return new SOAPFaultException(fault); } catch(SOAPException e) { throw new WebServiceException(e); } }
private SOAPFaultException createDuplicateHeaderException() { try { SOAPFault fault = soapVersion.getSOAPFactory().createFault(); fault.setFaultCode(soapVersion.faultCodeServer); fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName)); return new SOAPFaultException(fault); } catch(SOAPException e) { throw new WebServiceException(e); } }
private SOAPFaultException createSOAPFaultException(String faultString) throws SOAPException { SOAPFault fault = SOAPFactory.newInstance().createFault(); fault.setFaultString(faultString); SAAJUtils.setFaultCode(fault, new QName("http://cxf.apache.org/faultcode", "Server")); return new SOAPFaultException(fault); } private SOAPFaultException createSOAPFaultExceptionWithDetail(String faultString)
private SOAPFaultException createSOAPFaultException(String faultString) { try { SOAPFault fault = SOAPFactory.newInstance().createFault(); fault.setFaultString(faultString); SAAJUtils.setFaultCode(fault, new QName("http://cxf.apache.org/faultcode", "Server")); return new SOAPFaultException(fault); } catch (SOAPException e) { // do nothing } return null; }
private SOAPFaultException createSOAPFaultException(String faultString) { try { SOAPFault fault = SOAPFactory.newInstance().createFault(); fault.setFaultString(faultString); SAAJUtils.setFaultCode(fault, new QName("http://cxf.apache.org/faultcode", "Server")); return new SOAPFaultException(fault); } catch (SOAPException e) { // do nothing } return null; }
/** * Creates a SOAPFault element from SOS internal fault * * @param fault SOAPFault element * @param soapFault SOS internal fault * * @throws SOAPException if an error occurs. */ protected void createSOAPFault(SOAPFault fault, SoapFault soapFault) throws SOAPException { fault.setFaultCode(soapFault.getFaultCode()); fault.setFaultString(soapFault.getFaultReason(), soapFault.getLocale()); if (soapFault.getDetailText() != null) { fault.addDetail().setTextContent(soapFault.getDetailText()); } }