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


C# IChannel.GetProperty方法代码示例

本文整理汇总了C#中IChannel.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IChannel.GetProperty方法的具体用法?C# IChannel.GetProperty怎么用?C# IChannel.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IChannel的用法示例。


在下文中一共展示了IChannel.GetProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Get


//.........这里部分代码省略.........
                    }
                    else
                    {
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                            CreateWsrmRequiredException(messageVersion));
                    }
                }

                if (messageInfo.sequencedMessageInfo == null && message.IsFault)
                {
                    messageInfo.faultInfo = MessageFault.CreateFault(message, TransportDefaults.MaxRMFaultSize);
                    WsrmHeaderFault wsrmFault;

                    if (soap11)
                    {
                        if (WsrmHeaderFault.TryCreateFault11(reliableMessagingVersion, message, messageInfo.faultInfo, sequenceFaultIndex, out wsrmFault))
                        {
                            messageInfo.faultInfo = wsrmFault;
                            messageInfo.faultException = WsrmHeaderFault.CreateException(wsrmFault);
                        }
                    }
                    else
                    {
                        if (WsrmHeaderFault.TryCreateFault12(reliableMessagingVersion, message, messageInfo.faultInfo, out wsrmFault))
                        {
                            messageInfo.faultInfo = wsrmFault;
                            messageInfo.faultException = WsrmHeaderFault.CreateException(wsrmFault);
                        }
                    }

                    // Not a wsrm fault, maybe it is another fault we should understand (i.e. addressing or soap fault).
                    if (wsrmFault == null)
                    {
                        FaultConverter faultConverter = channel.GetProperty<FaultConverter>();

                        if (faultConverter == null)
                        {
                            faultConverter = FaultConverter.GetDefaultFaultConverter(messageVersion);
                        }

                        if (!faultConverter.TryCreateException(message, messageInfo.faultInfo, out messageInfo.faultException))
                        {
                            messageInfo.faultException = new ProtocolException(SR.GetString(SR.UnrecognizedFaultReceived, messageInfo.faultInfo.Code.Namespace, messageInfo.faultInfo.Code.Name, System.ServiceModel.FaultException.GetSafeReasonText(messageInfo.faultInfo)));
                        }
                    }

                    foundAction = true;
                }

                if (!foundHeader && !foundAction)
                {
                    if (wsrmFeb2005)
                    {
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                            new ActionNotSupportedException(SR.GetString(SR.NonWsrmFeb2005ActionNotSupported, action)));
                    }
                    else
                    {
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(
                            CreateWsrmRequiredException(messageVersion));
                    }
                }

                if (foundAction || WsrmUtilities.IsWsrmAction(reliableMessagingVersion, action))
                {
                    ValidateMustUnderstand(messageVersion, message);
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:67,代码来源:WsrmMessageInfo.cs

示例2: Get


//.........这里部分代码省略.........
         if (flag5)
         {
             System.ServiceModel.Channels.CreateSequenceInfo.ValidateCreateSequenceHeaders(messageVersion, session as ISecureConversationSession, info);
             ValidateMustUnderstand(messageVersion, message);
             return info;
         }
         if ((info.sequencedMessageInfo == null) && (info.action == null))
         {
             if (flag3)
             {
                 throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageHeaderException(System.ServiceModel.SR.GetString("NoActionNoSequenceHeaderReason"), messageVersion.Addressing.Namespace, "Action", false));
             }
             throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateWsrmRequiredException(messageVersion));
         }
         if ((info.sequencedMessageInfo == null) && message.IsFault)
         {
             System.ServiceModel.Channels.WsrmHeaderFault fault;
             info.faultInfo = System.ServiceModel.Channels.MessageFault.CreateFault(message, 0x10000);
             if (flag6)
             {
                 if (System.ServiceModel.Channels.WsrmHeaderFault.TryCreateFault11(reliableMessagingVersion, message, info.faultInfo, index, out fault))
                 {
                     info.faultInfo = fault;
                     info.faultException = WsrmFault.CreateException(fault);
                 }
             }
             else if (System.ServiceModel.Channels.WsrmHeaderFault.TryCreateFault12(reliableMessagingVersion, message, info.faultInfo, out fault))
             {
                 info.faultInfo = fault;
                 info.faultException = WsrmFault.CreateException(fault);
             }
             if (fault == null)
             {
                 FaultConverter property = channel.GetProperty<FaultConverter>();
                 if (property == null)
                 {
                     property = FaultConverter.GetDefaultFaultConverter(messageVersion);
                 }
                 if (!property.TryCreateException(message, info.faultInfo, out info.faultException))
                 {
                     info.faultException = new ProtocolException(System.ServiceModel.SR.GetString("UnrecognizedFaultReceived", new object[] { info.faultInfo.Code.Namespace, info.faultInfo.Code.Name, System.ServiceModel.FaultException.GetSafeReasonText(info.faultInfo) }));
                 }
             }
             flag2 = true;
         }
         if (!flag7 && !flag2)
         {
             if (flag3)
             {
                 throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ActionNotSupportedException(System.ServiceModel.SR.GetString("NonWsrmFeb2005ActionNotSupported", new object[] { action })));
             }
             throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateWsrmRequiredException(messageVersion));
         }
         if (!flag2 && !WsrmUtilities.IsWsrmAction(reliableMessagingVersion, action))
         {
             return info;
         }
         ValidateMustUnderstand(messageVersion, message);
     }
     catch (InternalFaultException exception)
     {
         if (System.ServiceModel.DiagnosticUtility.ShouldTraceInformation)
         {
             System.ServiceModel.DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Information);
         }
         info.FaultReply = exception.FaultReply;
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:67,代码来源:WsrmMessageInfo.cs


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