本文整理汇总了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);
示例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;