throw new WebServiceException(ex); SOAPFaultException exception = new SOAPFaultException(soapFault); if (ex instanceof Fault && ex.getCause() != null) { exception.initCause(ex.getCause());
private RuntimeException mapException(Exception ex) { if (ex instanceof Fault && ex.getCause() instanceof IOException) { throw new WebServiceException(ex.getMessage(), ex.getCause()); } if (getBinding() instanceof HTTPBinding) { HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR); exception.initCause(ex); return exception; } else if (getBinding() instanceof SOAPBinding) { SOAPFault soapFault = null; try { soapFault = JaxWsClientProxy.createSoapFault((SOAPBinding)getBinding(), ex); } catch (SOAPException e) { //ignore } if (soapFault == null) { return new WebServiceException(ex); } SOAPFaultException exception = new SOAPFaultException(soapFault); exception.initCause(ex); return exception; } return new WebServiceException(ex); }
private void checkError() { if (error != null) { if (getBinding() instanceof SOAPBinding) { SOAPFault soapFault = null; try { soapFault = JaxWsClientProxy.createSoapFault((SOAPBinding)getBinding(), new Exception(error.toString())); } catch (SOAPException e) { //ignore } if (soapFault != null) { throw new SOAPFaultException(soapFault); } } else if (getBinding() instanceof HTTPBinding) { HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR); exception.initCause(new Exception(error.toString())); throw exception; } throw new WebServiceException(error.toString()); } } private RuntimeException mapException(Exception ex) {
private void throwSecurityTokenUnavailable() throws SOAPFaultException { SOAPFault soapFault = createSoapFault(ErrorCodes.NULL_VALUE + "No security token could be found in the SOAP Header", SECURITY_TOKEN_UNAVAILABLE); throw new SOAPFaultException(soapFault); }
private void throwFailedAuthentication() throws SOAPFaultException { SOAPFault soapFault = createSoapFault("The security token could not be authenticated or authorized", FAILED_AUTHENTICATION); throw new SOAPFaultException(soapFault); }
private void throwSecurityTokenUnavailable() throws SOAPFaultException { SOAPFault soapFault = createSoapFault(ErrorCodes.NULL_VALUE + "No security token could be found in the SOAP Header", SECURITY_TOKEN_UNAVAILABLE); throw new SOAPFaultException(soapFault); }
private void throwFailedAuthentication() throws SOAPFaultException { SOAPFault soapFault = createSoapFault("The security token could not be authenticated or authorized", FAILED_AUTHENTICATION); throw new SOAPFaultException(soapFault); }
private void throwInvalidSecurity() throws SOAPFaultException { SOAPFault soapFault = createSoapFault("An error occurred while processing the security header", INVALID_SECURITY); throw new SOAPFaultException(soapFault); }
public static SOAPFaultException getSOAPFaultException(Exception ex, SOAPFactory factory, SOAPVersion version) { SOAPFault fault = getSOAPFault(MessageConstants.WSSE_INVALID_SECURITY, ex.getMessage(), factory, version); if (!enableFaultDetail) { return new SOAPFaultException(fault); } setFaultDetail(fault, ex); return new SOAPFaultException(fault); }
private void throwFailedAuthentication() throws SOAPFaultException { SOAPFault soapFault = createSoapFault("The security token could not be authenticated or authorized", FAILED_AUTHENTICATION); throw new SOAPFaultException(soapFault); }
private void throwSecurityTokenUnavailable() throws SOAPFaultException { SOAPFault soapFault = createSoapFault(ErrorCodes.NULL_VALUE + "No security token could be found in the SOAP Header", SECURITY_TOKEN_UNAVAILABLE); throw new SOAPFaultException(soapFault); }
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); }
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); } }
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.faultCodeClient); 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; }