/** * Select the Action URI value to return for the given {@link Fault}. * * @param fault the fault * @return the selected Action URI */ @Nonnull protected String selectActionURIForFault(@Nonnull final Fault fault) { QName faultCode = null; if (fault.getCode() != null && fault.getCode().getValue() != null) { faultCode = fault.getCode().getValue(); } if (faultCode != null && WSAddressingConstants.WS_ADDRESSING_FAULTS.contains(faultCode)) { return WSAddressingConstants.ACTION_URI_FAULT; } else { return WSAddressingConstants.ACTION_URI_SOAP_FAULT; } }
code = fault.getCode().getValue();
FaultCode.DEFAULT_ELEMENT_NAME); final FaultCode code = faultCodeBuilder.buildObject(FaultCode.DEFAULT_ELEMENT_NAME); code.setValue(defaultFaultCode); fault.setCode(code);
final Fault fault = (Fault) faults.get(0); if (fault.getCode() != null) { code = fault.getCode().getValue().toString();
.buildObject(FaultString.DEFAULT_ELEMENT_NAME); faultCodeObj.setValue(faultCode); faultObj.setCode(faultCodeObj);
/** {@inheritDoc} */ public void prepareContext() throws MessageEncodingException { MessageContext<MessageType> messageContext = getMessageContext(); XMLObject payload = null; Fault fault = SOAPMessagingSupport.getSOAP11Fault(messageContext); if (fault != null) { log.debug("Saw SOAP 1.1 Fault payload with fault code, replacing any existing context message: {}", fault.getCode() != null ? fault.getCode().getValue() : null); payload = fault; messageContext.setMessage(null); } else { payload = messageContext.getMessage(); } if (payload == null) { throw new MessageEncodingException("No outbound message or Fault contained in message context"); } if (payload instanceof Envelope) { storeSOAPEnvelope((Envelope) payload); } else { buildAndStoreSOAPMessage(payload); } }
faultCode.setValue(FaultCode.SERVER); fault.setCode(faultCode);
/** {@inheritDoc} */ public void prepareContext() throws MessageEncodingException { final MessageContext<SAMLObject> messageContext = getMessageContext(); XMLObject payload = null; final Fault fault = SOAPMessagingSupport.getSOAP11Fault(messageContext); if (fault != null) { log.debug("Saw SOAP 1.1 Fault payload with fault code, replacing any existing context message: {}", fault.getCode() != null ? fault.getCode().getValue() : null); payload = fault; messageContext.setMessage(null); } else { payload = messageContext.getMessage(); } if (payload == null) { throw new MessageEncodingException("No outbound message or Fault contained in message context"); } if (payload instanceof Envelope) { storeSOAPEnvelope((Envelope) payload); } else { buildAndStoreSOAPMessage(payload); } }