private void createMustUnderstandFault(SoapMessage soapResponse, List<QName> notUnderstoodHeaderNames, String[] actorsOrRoles) { if (logger.isWarnEnabled()) { logger.warn("Could not handle mustUnderstand headers: " + StringUtils.collectionToCommaDelimitedString(notUnderstoodHeaderNames) + ". Returning fault"); } SoapBody responseBody = soapResponse.getSoapBody(); SoapFault fault = responseBody.addMustUnderstandFault(mustUnderstandFaultString, mustUnderstandFaultStringLocale); if (!ObjectUtils.isEmpty(actorsOrRoles)) { fault.setFaultActorOrRole(actorsOrRoles[0]); } SoapHeader header = soapResponse.getSoapHeader(); if (header instanceof Soap12Header) { Soap12Header soap12Header = (Soap12Header) header; for (QName headerName : notUnderstoodHeaderNames) { soap12Header.addNotUnderstoodHeaderElement(headerName); } } }
private void createMustUnderstandFault(SoapMessage soapResponse, List<QName> notUnderstoodHeaderNames, String[] actorsOrRoles) { if (logger.isWarnEnabled()) { logger.warn("Could not handle mustUnderstand headers: " + StringUtils.collectionToCommaDelimitedString(notUnderstoodHeaderNames) + ". Returning fault"); } SoapBody responseBody = soapResponse.getSoapBody(); SoapFault fault = responseBody.addMustUnderstandFault(mustUnderstandFaultString, mustUnderstandFaultStringLocale); if (!ObjectUtils.isEmpty(actorsOrRoles)) { fault.setFaultActorOrRole(actorsOrRoles[0]); } SoapHeader header = soapResponse.getSoapHeader(); if (header instanceof Soap12Header) { Soap12Header soap12Header = (Soap12Header) header; for (QName headerName : notUnderstoodHeaderNames) { soap12Header.addNotUnderstoodHeaderElement(headerName); } } }
private void createMustUnderstandFault(SoapMessage soapResponse, List<QName> notUnderstoodHeaderNames, String[] actorsOrRoles) { if (logger.isWarnEnabled()) { logger.warn("Could not handle mustUnderstand headers: " + StringUtils.collectionToCommaDelimitedString(notUnderstoodHeaderNames) + ". Returning fault"); } SoapBody responseBody = soapResponse.getSoapBody(); SoapFault fault = responseBody.addMustUnderstandFault(mustUnderstandFaultString, mustUnderstandFaultStringLocale); if (!ObjectUtils.isEmpty(actorsOrRoles)) { fault.setFaultActorOrRole(actorsOrRoles[0]); } SoapHeader header = soapResponse.getSoapHeader(); if (header instanceof Soap12Header) { Soap12Header soap12Header = (Soap12Header) header; for (QName headerName : notUnderstoodHeaderNames) { soap12Header.addNotUnderstoodHeaderElement(headerName); } } }
private void createMustUnderstandFault(SoapMessage soapResponse, List<QName> notUnderstoodHeaderNames, String[] actorsOrRoles) { if (logger.isWarnEnabled()) { logger.warn("Could not handle mustUnderstand headers: " + StringUtils.collectionToCommaDelimitedString(notUnderstoodHeaderNames) + ". Returning fault"); } SoapBody responseBody = soapResponse.getSoapBody(); SoapFault fault = responseBody.addMustUnderstandFault(mustUnderstandFaultString, mustUnderstandFaultStringLocale); if (!ObjectUtils.isEmpty(actorsOrRoles)) { fault.setFaultActorOrRole(actorsOrRoles[0]); } SoapHeader header = soapResponse.getSoapHeader(); if (header instanceof Soap12Header) { Soap12Header soap12Header = (Soap12Header) header; for (QName headerName : notUnderstoodHeaderNames) { soap12Header.addNotUnderstoodHeaderElement(headerName); } } }
/** * Handles a fault exception.Default implementation logs the given exception, and creates a SOAP Fault with the * properties of the given exception, and returns {@code false}. * * @param ex the validation exception * @param messageContext the message context * @return {@code true} to continue processing the message, {@code false} (the default) otherwise */ protected boolean handleFaultException(WsSecurityFaultException ex, MessageContext messageContext) { if (logger.isWarnEnabled()) { logger.warn("Could not handle request: " + ex.getMessage()); } SoapBody response = ((SoapMessage) messageContext.getResponse()).getSoapBody(); SoapFault fault; if (response instanceof Soap11Body) { fault = ((Soap11Body) response).addFault(ex.getFaultCode(), ex.getFaultString(), Locale.ENGLISH); } else { fault = response.addClientOrSenderFault(ex.getFaultString(), Locale.ENGLISH); } fault.setFaultActorOrRole(ex.getFaultActor()); return false; }
/** * Handles a fault exception.Default implementation logs the given exception, and creates a SOAP Fault with the * properties of the given exception, and returns {@code false}. * * @param ex the validation exception * @param messageContext the message context * @return {@code true} to continue processing the message, {@code false} (the default) otherwise */ protected boolean handleFaultException(WsSecurityFaultException ex, MessageContext messageContext) { if (logger.isWarnEnabled()) { logger.warn("Could not handle request: " + ex.getMessage()); } SoapBody response = ((SoapMessage) messageContext.getResponse()).getSoapBody(); SoapFault fault; if (response instanceof Soap11Body) { fault = ((Soap11Body) response).addFault(ex.getFaultCode(), ex.getFaultString(), Locale.ENGLISH); } else { fault = response.addClientOrSenderFault(ex.getFaultString(), Locale.ENGLISH); } fault.setFaultActorOrRole(ex.getFaultActor()); return false; }
/** * Handles a fault exception.Default implementation logs the given exception, and creates a SOAP Fault with the * properties of the given exception, and returns {@code false}. * * @param ex the validation exception * @param messageContext the message context * @return {@code true} to continue processing the message, {@code false} (the default) otherwise */ protected boolean handleFaultException(WsSecurityFaultException ex, MessageContext messageContext) { if (logger.isWarnEnabled()) { logger.warn("Could not handle request: " + ex.getMessage()); } SoapBody response = ((SoapMessage) messageContext.getResponse()).getSoapBody(); SoapFault fault; if (response instanceof Soap11Body) { fault = ((Soap11Body) response).addFault(ex.getFaultCode(), ex.getFaultString(), Locale.ENGLISH); } else { fault = response.addClientOrSenderFault(ex.getFaultString(), Locale.ENGLISH); } fault.setFaultActorOrRole(ex.getFaultActor()); return false; }
soapFault.setFaultActorOrRole(replyMessage.getFaultActor());