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


C# ServiceModel.FaultCode类代码示例

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


FaultCode类属于System.ServiceModel命名空间,在下文中一共展示了FaultCode类的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: 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


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