Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / TransactionChannelFaultConverter.cs / 1 / TransactionChannelFaultConverter.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-------------------
namespace System.ServiceModel.Channels
{
using System;
using System.ServiceModel;
using System.Globalization;
class TransactionChannelFaultConverter: FaultConverter
where TChannel : class, IChannel
{
TransactionChannel channel;
internal TransactionChannelFaultConverter(TransactionChannel channel)
{
this.channel = channel;
}
protected override bool OnTryCreateException(Message message, MessageFault fault, out Exception exception)
{
if(message.Headers.Action == FaultCodeConstants.Actions.Transactions)
{
exception = new ProtocolException(fault.Reason.GetMatchingTranslation(CultureInfo.CurrentCulture).Text);
return true;
}
if(fault.IsMustUnderstandFault)
{
MessageHeader header = this.channel.Formatter.EmptyTransactionHeader;
if(MessageFault.WasHeaderNotUnderstood(message.Headers, header.Name, header.Namespace))
{
exception = new ProtocolException(SR.GetString(SR.SFxTransactionHeaderNotUnderstood, header.Name, header.Namespace, this.channel.Protocol));
return true;
}
}
FaultConverter inner = this.channel.GetInnerProperty();
if (inner != null)
{
return inner.TryCreateException(message, fault, out exception);
}
else
{
exception = null;
return false;
}
}
protected override bool OnTryCreateFaultMessage(Exception exception, out Message message)
{
FaultConverter inner = this.channel.GetInnerProperty();
if (inner != null)
{
return inner.TryCreateFaultMessage(exception, out message);
}
else
{
message = null;
return false;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CustomUserNameSecurityTokenAuthenticator.cs
- TagPrefixAttribute.cs
- PenThreadWorker.cs
- CalendarAutoFormatDialog.cs
- MethodBody.cs
- ReflectEventDescriptor.cs
- StylusPointPropertyId.cs
- WindowsRebar.cs
- ValidationError.cs
- FileVersion.cs
- ServiceSettingsResponseInfo.cs
- DuplexChannelFactory.cs
- CommandHelper.cs
- RetrieveVirtualItemEventArgs.cs
- ScrollContentPresenter.cs
- XmlElementAttribute.cs
- Int32CAMarshaler.cs
- PopupRootAutomationPeer.cs
- RecordBuilder.cs
- Operator.cs
- ByteKeyFrameCollection.cs
- ResourceProperty.cs
- RealizationDrawingContextWalker.cs
- DetailsViewDeletedEventArgs.cs
- TrustManagerPromptUI.cs
- RangeBase.cs
- XmlNamespaceManager.cs
- QueryableFilterUserControl.cs
- ExtenderControl.cs
- SessionPageStateSection.cs
- StyleModeStack.cs
- Condition.cs
- ColumnMapCopier.cs
- FontEmbeddingManager.cs
- BigInt.cs
- ListViewHitTestInfo.cs
- NotSupportedException.cs
- ObjectConverter.cs
- FixedStringLookup.cs
- CollectionView.cs
- RoutedEventValueSerializer.cs
- SelectorAutomationPeer.cs
- AppDomainShutdownMonitor.cs
- EdmError.cs
- ClientApiGenerator.cs
- ExpressionBindingCollection.cs
- FederatedMessageSecurityOverHttpElement.cs
- MethodBody.cs
- WeakReadOnlyCollection.cs
- ToolStripCodeDomSerializer.cs
- Handle.cs
- ReflectionUtil.cs
- Module.cs
- HttpWrapper.cs
- nulltextnavigator.cs
- DataColumnMappingCollection.cs
- AppDomainResourcePerfCounters.cs
- Pair.cs
- TrustLevel.cs
- CopyNodeSetAction.cs
- ConsoleKeyInfo.cs
- ProfileEventArgs.cs
- DockPatternIdentifiers.cs
- OptimisticConcurrencyException.cs
- AsyncCompletedEventArgs.cs
- PowerEase.cs
- EncodingDataItem.cs
- TransactionFormatter.cs
- ColumnWidthChangedEvent.cs
- WpfKnownType.cs
- DateTimeUtil.cs
- DetailsView.cs
- HostingEnvironmentException.cs
- DirectoryNotFoundException.cs
- ConsoleCancelEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- sqlmetadatafactory.cs
- HwndStylusInputProvider.cs
- Invariant.cs
- FormViewActionList.cs
- StylusPointProperty.cs
- WriteFileContext.cs
- TextTreeTextNode.cs
- FileLogRecord.cs
- MouseEventArgs.cs
- lengthconverter.cs
- QilLoop.cs
- XmlSchemaAttribute.cs
- DataGridToolTip.cs
- ProcessThread.cs
- RC2CryptoServiceProvider.cs
- DragEvent.cs
- TransformerInfoCollection.cs
- QueryRewriter.cs
- ClientBuildManager.cs
- GlyphingCache.cs
- _CommandStream.cs
- ServiceDeploymentInfo.cs
- IUnknownConstantAttribute.cs
- EpmContentDeSerializerBase.cs