当前位置: 首页>>代码示例>>C#>>正文


C# ServiceModel.FaultReason类代码示例

本文整理汇总了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);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:Fault.cs

示例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;
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:7,代码来源:FaultException.cs

示例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");
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:FaultException.cs

示例4: WsrmFault

 // remote
 protected WsrmFault(FaultCode code, string subcode, FaultReason reason)
 {
     this.code = code;
     this.subcode = subcode;
     this.reason = reason;
     this.isRemote = true;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:WsrmFault.cs

示例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);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:34,代码来源:WsrmHeaderFault.cs

示例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;
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:8,代码来源:MakeConnectionMessageFault.cs

示例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");
		}
开发者ID:nickchal,项目名称:pash,代码行数:9,代码来源:FaultReasonTest.cs

示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:XmlObjectSerializerFault.cs

示例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 = "";
 }
开发者ID:weshaggard,项目名称:wcf,代码行数:9,代码来源:WSAddressing10ProblemHeaderQNameFault.cs

示例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");
     }
 }
开发者ID:huoxudong125,项目名称:WCF-Demo,代码行数:13,代码来源:Program.cs

示例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);
        }
开发者ID:iivchenko,项目名称:Learning-WCF,代码行数:14,代码来源:Service.cs

示例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;
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:15,代码来源:MustUnderstandSoapException.cs

示例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);
        }
开发者ID:happy5217744,项目名称:AlarmWorkflow,代码行数:20,代码来源:AlarmWorkflowFaultDetails.cs


注:本文中的System.ServiceModel.FaultReason类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。