private static void triggerAddressingFault(MessageContext messageContext, String faultInformationKey, Object faultInformationValue, String faultcode, String faultSubcode, String faultReason) throws AxisFault { Map<String, Object> faultInformation = (Map<String, Object>)messageContext.getLocalProperty(Constants.FAULT_INFORMATION_FOR_HEADERS); if (faultInformation == null) { faultInformation = new HashMap<String, Object>(); messageContext.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInformation); } faultInformation.put(faultInformationKey, faultInformationValue); if (messageContext.isSOAP11()) { faultcode = (faultSubcode != null) ? faultSubcode : faultcode; } else { setFaultCode(messageContext, faultcode, faultSubcode); } OperationContext oc = messageContext.getOperationContext(); if (oc != null) { oc.setProperty(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS, "false"); } messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE); String namespace = (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); throw new AxisFault(faultReason, new QName(namespace, faultcode, AddressingConstants.WSA_DEFAULT_PREFIX)); }
private static void triggerAddressingFault(MessageContext messageContext, String faultInformationKey, Object faultInformationValue, String faultcode, String faultSubcode, String faultReason) throws AxisFault { Map<String, Object> faultInformation = (Map<String, Object>)messageContext.getLocalProperty(Constants.FAULT_INFORMATION_FOR_HEADERS); if (faultInformation == null) { faultInformation = new HashMap<String, Object>(); messageContext.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInformation); } faultInformation.put(faultInformationKey, faultInformationValue); if (messageContext.isSOAP11()) { faultcode = (faultSubcode != null) ? faultSubcode : faultcode; } else { setFaultCode(messageContext, faultcode, faultSubcode); } OperationContext oc = messageContext.getOperationContext(); if (oc != null) { oc.setProperty(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS, "false"); } messageContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE); String namespace = (String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION); throw new AxisFault(faultReason, new QName(namespace, faultcode, AddressingConstants.WSA_DEFAULT_PREFIX)); }