• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ServiceModel.FaultCode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ServiceModel.FaultCode的典型用法代码示例。如果您正苦于以下问题:C# FaultCode类的具体用法?C# FaultCode怎么用?C# FaultCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FaultCode类属于System.ServiceModel命名空间,在下文中一共展示了FaultCode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: HandleClientFaultException

		private FaultException HandleClientFaultException(Exception exception, Guid errorId)
		{
			string clientMessage = "The operation could not be performed. Reason: internal server error.";
			FaultCode code = new FaultCode(exception.GetType().Name);
			string errorMessage = String.Format("{0} Error Id: [{1}].{2}{3}", clientMessage, errorId, Environment.NewLine, Logger.ErrorLogEntityToString(Logger.GetExceptionLogEntity(exception)));
			return new FaultException(new FaultReason(errorMessage), FaultCode.CreateReceiverFaultCode(code));
		}
开发者ID:evkap,项目名称:DVS,代码行数:7,代码来源:WCFServiceExceptionHandler.cs


示例3: ProvideFaultOfLastResort

 void ProvideFaultOfLastResort(Exception error, ref ErrorHandlerFaultInfo faultInfo)
 {
     if (faultInfo.Fault == null)
     {
         FaultCode code = new FaultCode(FaultCodeConstants.Codes.InternalServiceFault, FaultCodeConstants.Namespaces.NetDispatch);
         code = FaultCode.CreateReceiverFaultCode(code);
         string action = FaultCodeConstants.Actions.NetDispatcher;
         MessageFault fault;
         if (this.debug)
         {
             faultInfo.DefaultFaultAction = action;
             fault = MessageFault.CreateFault(code, new FaultReason(error.Message), new ExceptionDetail(error));
         }
         else
         {
             string reason = this.isOnServer ? SR.GetString(SR.SFxInternalServerError) : SR.GetString(SR.SFxInternalCallbackError);
             fault = MessageFault.CreateFault(code, new FaultReason(reason));
         }
         faultInfo.IsConsideredUnhandled = true;
         faultInfo.Fault = Message.CreateMessage(this.messageVersion, fault, action);
     }
     //if this is an InternalServiceFault coming from another service dispatcher we should treat it as unhandled so that the channels are cleaned up
     else if (error != null)
     {
         FaultException e = error as FaultException;
         if (e != null && e.Fault != null && e.Fault.Code != null && e.Fault.Code.SubCode != null &&
             string.Compare(e.Fault.Code.SubCode.Namespace, FaultCodeConstants.Namespaces.NetDispatch, StringComparison.Ordinal) == 0 &&
             string.Compare(e.Fault.Code.SubCode.Name, FaultCodeConstants.Codes.InternalServiceFault, StringComparison.Ordinal) == 0)
         {
             faultInfo.IsConsideredUnhandled = true;
         }
     }
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:33,代码来源:ErrorBehavior.cs


示例4: FaultCode

 public FaultCode(string name, string ns, FaultCode subCode)
 {
     if (name == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("name"));
     }
     if (name.Length == 0)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("name"));
     }
     if (!string.IsNullOrEmpty(ns))
     {
         NamingHelper.CheckUriParameter(ns, "ns");
     }
     this.name = name;
     this.ns = ns;
     this.subCode = subCode;
     if (ns == "http://www.w3.org/2003/05/soap-envelope")
     {
         this.version = EnvelopeVersion.Soap12;
     }
     else if (ns == "http://schemas.xmlsoap.org/soap/envelope/")
     {
         this.version = EnvelopeVersion.Soap11;
     }
     else if (ns == "http://schemas.microsoft.com/ws/2005/05/envelope/none")
     {
         this.version = EnvelopeVersion.None;
     }
     else
     {
         this.version = null;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:34,代码来源:FaultCode.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: Check

 public virtual bool Check(FaultCode code)
 {
    return code.IsReceiverFault &&
           code.SubCode != null &&
           CheckCodeName(code) &&
           CheckCodeNamespace(code);
 }
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:FaultFactory.cs


示例7: 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


示例8: TestDefaults

		public void TestDefaults ()
		{
			code = new FaultCode ("foo");
			Assert.AreEqual ("foo", code.Name);
			Assert.AreEqual (String.Empty, code.Namespace);
			Assert.AreEqual (null, code.SubCode);			
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:FaultCodeTest.cs


示例9: FaultException

 internal FaultException(string reason, FaultCode code, string action, Exception innerException)
     : base(reason, innerException)
 {
     this.code = FaultException.EnsureCode(code);
     this.reason = FaultException.CreateReason(reason);
     this.action = action;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:FaultException.cs


示例10: 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


示例11: CreateMessage

 public Message CreateMessage(MessageVersion messageVersion, ReliableMessagingVersion reliableMessagingVersion)
 {
     this.SetReliableMessagingVersion(reliableMessagingVersion);
     string faultActionString = WsrmIndex.GetFaultActionString(messageVersion.Addressing, reliableMessagingVersion);
     if (messageVersion.Envelope == EnvelopeVersion.Soap11)
     {
         this.code = this.Get11Code(this.code, this.subcode);
     }
     else
     {
         if (messageVersion.Envelope != EnvelopeVersion.Soap12)
         {
             throw Fx.AssertAndThrow("Unsupported MessageVersion.");
         }
         if (this.code.SubCode == null)
         {
             FaultCode subCode = new FaultCode(this.subcode, WsrmIndex.GetNamespaceString(reliableMessagingVersion));
             this.code = new FaultCode(this.code.Name, this.code.Namespace, subCode);
         }
         this.hasDetail = this.Get12HasDetail();
     }
     Message message = Message.CreateMessage(messageVersion, this, faultActionString);
     this.OnFaultMessageCreated(messageVersion, message);
     return message;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:WsrmFault.cs


示例12: 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


示例13: CreateInstanceNotFoundFault

 public static OperationExecutionFault CreateInstanceNotFoundFault(string description)
 {
     if (instanceNotFoundCode == null)
     {
         instanceNotFoundCode = new FaultCode(XD2.WorkflowControlServiceFaults.InstanceNotFound, XD2.WorkflowServices.Namespace);
     }
     return new OperationExecutionFault(description, instanceNotFoundCode);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:OperationExecutionFault.cs


示例14: 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


示例15: CreateSuspendedFault

 public static OperationExecutionFault CreateSuspendedFault(Guid instanceId, string operationName)
 {
     if (instanceSuspendedFaultCode == null)
     {
         instanceSuspendedFaultCode = new FaultCode("InstanceSuspended", "http://schemas.datacontract.org/2008/10/WorkflowServices");
     }
     return new OperationExecutionFault(System.ServiceModel.Activities.SR.InstanceSuspended(operationName, instanceId), instanceSuspendedFaultCode);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:OperationExecutionFault.cs


示例16: CreateOperationNotAvailableFault

 public static OperationExecutionFault CreateOperationNotAvailableFault(Guid instanceId, string operationName)
 {
     if (operationNotAvailableFaultCode == null)
     {
         operationNotAvailableFaultCode = new FaultCode("OperationNotAvailable", "http://schemas.datacontract.org/2008/10/WorkflowServices");
     }
     return new OperationExecutionFault(System.ServiceModel.Activities.SR.OperationNotAvailable(operationName, instanceId), operationNotAvailableFaultCode);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:OperationExecutionFault.cs


示例17: CreateInstanceUnloadedFault

 public static OperationExecutionFault CreateInstanceUnloadedFault(string description)
 {
     if (instanceUnloadedFaultCode == null)
     {
         instanceUnloadedFaultCode = new FaultCode("InstanceUnloaded", "http://schemas.datacontract.org/2008/10/WorkflowServices");
     }
     return new OperationExecutionFault(description, instanceUnloadedFaultCode);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:OperationExecutionFault.cs


示例18: 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


示例19: CreateTransactedLockException

 public static OperationExecutionFault CreateTransactedLockException(Guid instanceId, string operationName)
 {
     if (instanceLockedFaultCode == null)
     {
         instanceLockedFaultCode = new FaultCode(XD2.WorkflowControlServiceFaults.InstanceLockedUnderTransaction, XD2.WorkflowServices.Namespace);
     }
     return new OperationExecutionFault(SR2.InstanceLockedUnderTransaction(operationName, instanceId), instanceLockedFaultCode);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:OperationExecutionFault.cs


示例20: CreateReceiverFaultCode

 public static FaultCode CreateReceiverFaultCode(FaultCode subCode)
 {
     if (subCode == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("subCode"));
     }
     return new FaultCode("Receiver", subCode);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:FaultCode.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ServiceModel.FaultException类代码示例发布时间:2022-05-26
下一篇:
C# ServiceModel.EndpointIdentity类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap