private SoapFault createSOAPFault(Throwable ex) { String faultString = "Internal STS error"; QName faultCode = null; if (ex != null) { if (ex instanceof STSException && ((STSException)ex).getFaultCode() != null) { faultCode = ((STSException)ex).getFaultCode(); } faultString = ex.getMessage(); } MessageContext messageContext = context.getMessageContext(); SoapVersion soapVersion = (SoapVersion)messageContext.get(SoapVersion.class.getName()); SoapFault fault; if (soapVersion.getVersion() == 1.1 && faultCode != null) { fault = new SoapFault(faultString, faultCode); } else { fault = new SoapFault(faultString, soapVersion.getSender()); if (soapVersion.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode); } } return fault; }
private SoapFault createSOAPFault(Throwable ex) { String faultString = "Internal STS error"; QName faultCode = null; if (ex != null) { if (ex instanceof STSException && ((STSException)ex).getFaultCode() != null) { faultCode = ((STSException)ex).getFaultCode(); } faultString = ex.getMessage(); } MessageContext messageContext = context.getMessageContext(); SoapVersion soapVersion = (SoapVersion)messageContext.get(SoapVersion.class.getName()); SoapFault fault; if (soapVersion.getVersion() == 1.1 && faultCode != null) { fault = new SoapFault(faultString, faultCode); } else { fault = new SoapFault(faultString, soapVersion.getSender()); if (soapVersion.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode); } } return fault; }
Fault createSoap12Fault(JMSFault jmsFault) { SoapFault fault = new SoapFault(jmsFault.getReason(), jmsFault.isSender() ? version.getSender() : version.getReceiver()); QName subCode = jmsFault.getSubCode(); fault.setSubCode(subCode); Object detail = jmsFault.getDetail(); if (null == detail) { return fault; } setDetail(fault, detail); return fault; }
Fault createSoap12Fault(JMSFault jmsFault) { SoapFault fault = new SoapFault(jmsFault.getReason(), jmsFault.isSender() ? version.getSender() : version.getReceiver()); QName subCode = jmsFault.getSubCode(); fault.setSubCode(subCode); Object detail = jmsFault.getDetail(); if (null == detail) { return fault; } setDetail(fault, detail); return fault; }
Fault createSoap12Fault(SequenceFault sf, Message msg) { SoapFault fault = (SoapFault)createSoap11Fault(sf); fault.setSubCode(sf.getFaultCode()); Object detail = sf.getDetail(); if (null == detail) { return fault; } try { RMProperties rmps = RMContextUtils.retrieveRMProperties(msg, false); AddressingProperties maps = RMContextUtils.retrieveMAPs(msg, false, false); EncoderDecoder codec = ProtocolVariation.findVariant(rmps.getNamespaceURI(), maps.getNamespaceURI()).getCodec(); setDetail(fault, detail, codec); } catch (Exception ex) { LogUtils.log(LOG, Level.SEVERE, "MARSHAL_FAULT_DETAIL_EXC", ex); ex.printStackTrace(); } return fault; }
/** * Create a SoapFault from a WSSecurityException, following the SOAP Message Security * 1.1 specification, chapter 12 "Error Handling". * * When the Soap version is 1.1 then set the Fault/Code/Value from the fault code * specified in the WSSecurityException (if it exists). * * Otherwise set the Fault/Code/Value to env:Sender and the Fault/Code/Subcode/Value * as the fault code from the WSSecurityException. */ private SoapFault createSoapFault(SoapVersion version, WSSecurityException e) { SoapFault fault; javax.xml.namespace.QName faultCode = e.getFaultCode(); if (version.getVersion() == 1.1 && faultCode != null) { fault = new SoapFault(e.getMessage(), e, faultCode); } else { fault = new SoapFault(e.getMessage(), e, version.getSender()); if (version.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode); } } return fault; }
/** * Create a SoapFault from a WSSecurityException, following the SOAP Message Security * 1.1 specification, chapter 12 "Error Handling". * * When the Soap version is 1.1 then set the Fault/Code/Value from the fault code * specified in the WSSecurityException (if it exists). * * Otherwise set the Fault/Code/Value to env:Sender and the Fault/Code/Subcode/Value * as the fault code from the WSSecurityException. */ private SoapFault createSoapFault(SoapVersion version, WSSecurityException e) { SoapFault fault; javax.xml.namespace.QName faultCode = e.getFaultCode(); if (version.getVersion() == 1.1 && faultCode != null) { fault = new SoapFault(e.getMessage(), e, faultCode); } else { fault = new SoapFault(e.getMessage(), e, version.getSender()); if (version.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode); } } return fault; }
/** * Create a SoapFault from a WSSecurityException, following the SOAP Message Security * 1.1 specification, chapter 12 "Error Handling". * * When the Soap version is 1.1 then set the Fault/Code/Value from the fault code * specified in the WSSecurityException (if it exists). * * Otherwise set the Fault/Code/Value to env:Sender and the Fault/Code/Subcode/Value * as the fault code from the WSSecurityException. */ private SoapFault createSoapFault(SoapVersion version, WSSecurityException e) { SoapFault fault; javax.xml.namespace.QName faultCode = e.getFaultCode(); if (version.getVersion() == 1.1 && faultCode != null) { fault = new SoapFault(e.getMessage(), e, faultCode); } else { fault = new SoapFault(e.getMessage(), e, version.getSender()); if (version.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode); } } return fault; } }
/** * Create a SoapFault from a WSSecurityException, following the SOAP Message Security * 1.1 specification, chapter 12 "Error Handling". * * When the Soap version is 1.1 then set the Fault/Code/Value from the fault code * specified in the WSSecurityException (if it exists). * * Otherwise set the Fault/Code/Value to env:Sender and the Fault/Code/Subcode/Value * as the fault code from the WSSecurityException. */ private SoapFault createSoapFault(SoapVersion version, WSSecurityException e) { SoapFault fault; javax.xml.namespace.QName faultCode = e.getFaultCode(); if (version.getVersion() == 1.1 && faultCode != null) { fault = new SoapFault(e.getMessage(), e, faultCode); } else { fault = new SoapFault(e.getMessage(), e, version.getSender()); if (version.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode); } } return fault; } }
fault = new SoapFault(errorMessage, e, version.getSender()); if (version.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode);
fault = new SoapFault(errorMessage, e, version.getSender()); if (version.getVersion() != 1.1 && faultCode != null) { fault.setSubCode(faultCode);
SoapFault soap12Fault = new SoapFault(ContextUtils.retrieveMAPFaultReason(message), Soap12.getInstance().getSender()); soap12Fault.setSubCode(new QName(Names.WSA_NAMESPACE_NAME, ContextUtils .retrieveMAPFaultName(message))); throw soap12Fault;
SoapFault soap12Fault = new SoapFault(ContextUtils.retrieveMAPFaultReason(message), Soap12.getInstance().getSender()); soap12Fault.setSubCode(new QName(Names.WSA_NAMESPACE_NAME, ContextUtils .retrieveMAPFaultName(message))); throw soap12Fault;