本文整理汇总了C#中System.ServiceModel.FaultReason类的典型用法代码示例。如果您正苦于以下问题:C# FaultReason类的具体用法?C# FaultReason怎么用?C# FaultReason使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FaultReason类属于System.ServiceModel命名空间,在下文中一共展示了FaultReason类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fault
public Fault(string action, FaultCode code, string reasonText)
{
this.action = action;
this.code = code;
this.reasonText = reasonText;
this.reason = new FaultReason(reasonText, CultureInfo.CurrentCulture);
}
示例2: FaultException
internal FaultException(FaultReason reason, FaultCode code, string action, Exception innerException)
: base(FaultException.GetSafeReasonText(reason), innerException)
{
_code = FaultException.EnsureCode(code);
_reason = FaultException.EnsureReason(reason);
_action = action;
}
示例3: FaultException
protected FaultException(SerializationInfo info, StreamingContext context) : base(info, context)
{
this.code = this.ReconstructFaultCode(info, "code");
this.reason = this.ReconstructFaultReason(info, "reason");
this.fault = (MessageFault) info.GetValue("messageFault", typeof(MessageFault));
this.action = info.GetString("action");
}
示例4: WsrmFault
// remote
protected WsrmFault(FaultCode code, string subcode, FaultReason reason)
{
this.code = code;
this.subcode = subcode;
this.reason = reason;
this.isRemote = true;
}
示例5: CreateWsrmHeaderFault
private static WsrmHeaderFault CreateWsrmHeaderFault(ReliableMessagingVersion reliableMessagingVersion, FaultCode code, string subcode, FaultReason reason, XmlDictionaryReader detailReader)
{
if (code.IsSenderFault)
{
if (subcode == "InvalidAcknowledgement")
{
return new InvalidAcknowledgementFault(code, reason, detailReader, reliableMessagingVersion);
}
if (subcode == "MessageNumberRollover")
{
return new MessageNumberRolloverFault(code, reason, detailReader, reliableMessagingVersion);
}
if (subcode == "UnknownSequence")
{
return new UnknownSequenceFault(code, reason, detailReader, reliableMessagingVersion);
}
if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
{
if (subcode == "LastMessageNumberExceeded")
{
return new LastMessageNumberExceededFault(code, reason, detailReader, reliableMessagingVersion);
}
}
else if ((reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) && (subcode == "SequenceClosed"))
{
return new SequenceClosedFault(code, reason, detailReader, reliableMessagingVersion);
}
}
if (!code.IsSenderFault && !code.IsReceiverFault)
{
return null;
}
return new SequenceTerminatedFault(code, reason, detailReader, reliableMessagingVersion);
}
示例6: MakeConnectionMessageFault
protected MakeConnectionMessageFault(Message message, FaultCode code, string subcode, FaultReason reason)
{
this.code = code;
this.subcode = subcode;
this.reason = reason;
this.isRemote = true;
this.originalMessageId = message.Headers.MessageId;
}
示例7: WSAddressing10ProblemHeaderQNameFault
public WSAddressing10ProblemHeaderQNameFault(ActionMismatchAddressingException e)
{
this.invalidHeaderName = "Action";
this.code = FaultCode.CreateSenderFaultCode(new FaultCode("ActionMismatch", AddressingVersion.WSAddressing10.Namespace));
this.reason = new FaultReason(e.Message, CultureInfo.CurrentCulture);
this.actor = "";
this.node = "";
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:WSAddressing10ProblemHeaderQNameFault.cs
示例8: Simple
public void Simple ()
{
FaultReason r = new FaultReason ("testing");
FaultReasonText t = r.GetMatchingTranslation ();
Assert.IsNotNull (t);
Assert.AreEqual ("testing", t.Text, "#1");
Assert.AreEqual (CultureInfo.CurrentCulture.Name,
t.XmlLang, "#2");
}
示例9: XmlObjectSerializerFault
public XmlObjectSerializerFault(FaultCode code, FaultReason reason, object detail, XmlObjectSerializer serializer, string actor, string node)
{
this.code = code;
this.reason = reason;
this.detail = detail;
this.serializer = serializer;
this.actor = actor;
this.node = node;
}
示例10: WSAddressing10ProblemHeaderQNameFault
public WSAddressing10ProblemHeaderQNameFault(ActionMismatchAddressingException e)
{
_invalidHeaderName = AddressingStrings.Action;
_code = FaultCode.CreateSenderFaultCode(
new FaultCode(Addressing10Strings.ActionMismatch, AddressingVersion.WSAddressing10.Namespace));
_reason = new FaultReason(e.Message, CultureInfo.CurrentCulture);
_actor = "";
_node = "";
}
示例11: InvalidAcknowledgementFault
public InvalidAcknowledgementFault(FaultCode code, FaultReason reason, XmlDictionaryReader detailReader, ReliableMessagingVersion reliableMessagingVersion) : base(code, "InvalidAcknowledgement", reason, true, false)
{
UniqueId id;
bool flag;
WsrmAcknowledgmentInfo.ReadAck(reliableMessagingVersion, detailReader, out id, out this.ranges, out flag);
base.SequenceID = id;
while (detailReader.IsStartElement())
{
detailReader.Skip();
}
detailReader.ReadEndElement();
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:InvalidAcknowledgementFault.cs
示例12: Main
static void Main(string[] args)
{
FaultCode code = FaultCode.CreateSenderFaultCode("calcuError", "http://www.artech.com");
FaultReasonText reasonText1 = new FaultReasonText("Divided by zero!", "en-US");
FaultReasonText reasonText2 = new FaultReasonText("试图除以零!", "zh-CN");
FaultReason reason = new FaultReason(new FaultReasonText[] { reasonText1, reasonText2 });
MessageFault fault = MessageFault.CreateFault(code, reason);
string action = "http://www.artech.com/divideFault";
using (Message message = Message.CreateMessage(MessageVersion.Default, fault, action))
{
WriteMessage(message, "message.xml");
}
}
示例13: ThrowGenericFaultException
public void ThrowGenericFaultException()
{
var details = new ErrorDetails
{
Code = 666,
Name = "Devil",
Description = "This is the end!"
};
var reason = new FaultReason("This is the FulaReason");
var code = FaultCode.CreateReceiverFaultCode("ThrowGenericFaultException", "Server.Service");
throw new FaultException<ErrorDetails>(details, reason, code);
}
示例14: ProvideFault
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 = System.ServiceModel.Channels.Message.CreateMessage(messageVersion, fault, faultAction);
if (_envelopeVersion == EnvelopeVersion.Soap12)
{
this.AddNotUnderstoodHeaders(message.Headers);
}
return message;
}
示例15: CreateFault
/// <summary>
/// Creates a new FaultException with our fault details based on an existing exception.
/// </summary>
/// <param name="exception">The exception to wrap.</param>
/// <returns></returns>
public static FaultException<AlarmWorkflowFaultDetails> CreateFault(Exception exception)
{
Assertions.AssertNotNull(exception, "exception");
if (exception is FaultException<AlarmWorkflowFaultDetails>)
{
return (FaultException<AlarmWorkflowFaultDetails>)exception;
}
FaultReason reason = new FaultReason(exception.Message);
FaultCode code = new FaultCode("(No code)");
AlarmWorkflowFaultDetails detail = new AlarmWorkflowFaultDetails(exception);
return new FaultException<AlarmWorkflowFaultDetails>(detail, reason, code);
}