protected FaultException(SerializationInfo info, StreamingContext context) : base(info, context) { _code = ReconstructFaultCode(info, "code"); _reason = ReconstructFaultReason(info, "reason"); _fault = (MessageFault)info.GetValue("messageFault", typeof(MessageFault)); _action = (string)info.GetString("action"); }
public WSAddressing10ProblemHeaderQNameFault(ActionMismatchAddressingException e) { _invalidHeaderName = AddressingStrings.Action; _code = FaultCode.CreateSenderFaultCode( new FaultCode(Addressing10Strings.ActionMismatch, AddressingVersion.WSAddressing10.Namespace)); _reason = new FaultReason(new FaultReasonText(e.Message, CultureInfo.CurrentCulture.Name)); _actor = ""; _node = ""; }
public FaultException(MessageFault fault) : base(GetSafeReasonText(GetReason(fault))) { if (fault == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("fault"); } _code = EnsureCode(fault.Code); _reason = EnsureReason(fault.Reason); _fault = fault; }
public FaultException(MessageFault fault, string action) : base(FaultException.GetSafeReasonText(GetReason(fault))) { if (fault == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("fault"); } code = fault.Code; reason = fault.Reason; this.fault = fault; this.action = action; }
public FaultException(MessageFault fault, string action) : base(GetSafeReasonText(GetReason(fault))) { if (fault == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(fault)); } _code = fault.Code; _reason = fault.Reason; _fault = fault; _action = action; }
internal static FaultReasonData[] GetObjectData(FaultReason reason) { ReadOnlyCollection <FaultReasonText> translations = reason.Translations; FaultReasonData[] array = new FaultReasonData[translations.Count]; for (int i = 0; i < translations.Count; i++) { array[i] = new FaultReasonData(); array[i].xmlLang = translations[i].XmlLang; array[i].text = translations[i].Text; } return(array); }
internal Message ProvideFault(MessageVersion messageVersion) { string name = notUnderstoodHeaders[0].Name; string ns = notUnderstoodHeaders[0].Namespace; FaultCode code = new FaultCode(MessageStrings.MustUnderstandFault, envelopeVersion.Namespace); FaultReason reason = new FaultReason(SR.Format(SR.SFxHeaderNotUnderstood, name, ns), CultureInfo.CurrentCulture); MessageFault fault = MessageFault.CreateFault(code, reason); string faultAction = messageVersion.Addressing.DefaultFaultAction; Message message = CoreWCF.Channels.Message.CreateMessage(messageVersion, fault, faultAction); if (envelopeVersion == EnvelopeVersion.Soap12) { AddNotUnderstoodHeaders(message.Headers); } return(message); }
public WSAddressing10ProblemHeaderQNameFault(MessageHeaderException e) { _invalidHeaderName = e.HeaderName; if (e.IsDuplicate) { _code = FaultCode.CreateSenderFaultCode( new FaultCode(Addressing10Strings.InvalidAddressingHeader, AddressingVersion.WSAddressing10.Namespace, new FaultCode(Addressing10Strings.InvalidCardinality, AddressingVersion.WSAddressing10.Namespace))); } else { _code = FaultCode.CreateSenderFaultCode( new FaultCode(Addressing10Strings.MessageAddressingHeaderRequired, AddressingVersion.WSAddressing10.Namespace)); } _reason = new FaultReason(new FaultReasonText(e.Message, CultureInfo.CurrentCulture.Name)); _actor = ""; _node = ""; }
internal static string GetSafeReasonText(FaultReason reason) { if (reason == null) { return(SR.SFxUnknownFaultNullReason0); } try { return(reason.GetMatchingTranslation(System.Globalization.CultureInfo.CurrentCulture).Text); } catch (ArgumentException) { if (reason.Translations.Count == 0) { return(SR.SFxUnknownFaultZeroReasons0); } else { return(SR.Format(SR.SFxUnknownFaultNoMatchingTranslation1, reason.Translations[0].Text)); } } }
public FaultException(FaultReason reason, FaultCode code) : base(GetSafeReasonText(reason)) { _code = EnsureCode(code); _reason = EnsureReason(reason); }
// public on full framework internal FaultException(FaultReason reason, FaultCode code) : base(FaultException.GetSafeReasonText(reason)) { this.code = FaultException.EnsureCode(code); this.reason = FaultException.EnsureReason(reason); }
internal void AddFaultReasonObjectData(SerializationInfo info, string key, FaultReason reason) { info.AddValue(key, FaultReasonData.GetObjectData(reason)); }
internal FaultException(string reason, FaultCode code) : base(reason) { this.code = FaultException.EnsureCode(code); this.reason = FaultException.CreateReason(reason); }
public FaultException() : base(SR.SFxFaultReason) { _code = DefaultCode; _reason = DefaultReason; }
public FaultException() : base(SR.SFxFaultReason) { code = FaultException.DefaultCode; reason = FaultException.DefaultReason; }
static FaultReason EnsureReason(FaultReason reason) { return(reason ?? DefaultReason); }
static FaultReason EnsureReason(FaultReason reason) { return((reason != null) ? reason : DefaultReason); }
public FaultException(string reason) : base(reason) { _code = DefaultCode; _reason = CreateReason(reason); }
public FaultException(string reason, FaultCode code) : base(reason) { _code = EnsureCode(code); _reason = CreateReason(reason); }
public FaultException(FaultReason reason) : base(GetSafeReasonText(reason)) { _code = DefaultCode; _reason = EnsureReason(reason); }