Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Routing / System / ServiceModel / Routing / RoutingUtilities.cs / 1305376 / RoutingUtilities.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Routing { using System; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.Transactions; using SR2 = System.ServiceModel.Routing.SR; using System.Runtime; static class RoutingUtilities { internal const string RoutingNamespace = "http://schemas.microsoft.com/netfx/2009/05/routing"; internal static void Abort(ICommunicationObject commObj, object identifier) { if (TD.RoutingServiceAbortingChannelIsEnabled()) { TD.RoutingServiceAbortingChannel(identifier != null ? identifier.ToString() : string.Empty); } //The Exception contract for ICommunicationObject.Abort is to never throw, anything else is a fatal error. commObj.Abort(); } internal static bool IsMessageUsingWSSecurity(UnderstoodHeaders understoodHeaders) { foreach (MessageHeaderInfo headerInfo in understoodHeaders) { if (string.Equals(headerInfo.Namespace, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", StringComparison.Ordinal) || //wsu string.Equals(headerInfo.Namespace, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", StringComparison.Ordinal) || //wsse string.Equals(headerInfo.Namespace, "http://docs.oasis-open.org/wss/oasis-wss-wsecurity-secext-1.1.xsd", StringComparison.Ordinal)) //wsse11 { return true; } } return false; } internal static string GetAddressingNamespace(AddressingVersion addressing) { string ns; if (addressing == AddressingVersion.WSAddressingAugust2004) { ns = "http://schemas.xmlsoap.org/ws/2004/08/addressing"; } else if (addressing == AddressingVersion.WSAddressing10) { ns = "http://www.w3.org/2005/08/addressing"; } else if (addressing == AddressingVersion.None) { ns = "http://schemas.microsoft.com/ws/2005/05/addressing/none"; } else { throw FxTrace.Exception.Argument("addressing", SR2.AddressingVersionInvalid(addressing.ToString())); } return ns; } internal static bool IsRoutingServiceNamespace(string contractNamespace) { return string.Equals(contractNamespace, RoutingUtilities.RoutingNamespace, StringComparison.Ordinal); } internal static bool IsTransactedReceive(Binding binding, BindingParameterCollection bindingParameters) { // New school ITransactedBindingElement transactedBindingElement = binding.GetProperty(bindingParameters); if (transactedBindingElement != null) { return transactedBindingElement.TransactedReceiveEnabled; } // Old School foreach (BindingElement element in binding.CreateBindingElements()) { transactedBindingElement = element as ITransactedBindingElement; if (transactedBindingElement != null && transactedBindingElement.TransactedReceiveEnabled) { return true; } } return false; } internal static void SafeRollbackTransaction(CommittableTransaction transaction) { if (transaction != null) { try { transaction.Rollback(); transaction.Dispose(); } catch (TransactionException transactionException) { if (TD.RoutingServiceHandledExceptionIsEnabled()) { TD.RoutingServiceHandledException(transactionException); } } catch (ObjectDisposedException disposedException) { if (TD.RoutingServiceHandledExceptionIsEnabled()) { TD.RoutingServiceHandledException(disposedException); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EdmToObjectNamespaceMap.cs
- COM2IDispatchConverter.cs
- FieldAccessException.cs
- StylusEventArgs.cs
- ListContractAdapter.cs
- GridToolTip.cs
- DataGridTableCollection.cs
- FlagsAttribute.cs
- XmlTextAttribute.cs
- PathGeometry.cs
- ExpressionBinding.cs
- WebPartPersonalization.cs
- StrokeCollection2.cs
- TrackingStringDictionary.cs
- PerformanceCountersBase.cs
- XmlSchemaType.cs
- XmlReflectionMember.cs
- FormatterServices.cs
- updatecommandorderer.cs
- StackBuilderSink.cs
- CustomCategoryAttribute.cs
- CommandSet.cs
- MachineKeySection.cs
- ProvidePropertyAttribute.cs
- GatewayDefinition.cs
- RenderData.cs
- TextFormatterHost.cs
- ComPersistableTypeElementCollection.cs
- log.cs
- Html32TextWriter.cs
- ApplicationInfo.cs
- HandlerMappingMemo.cs
- GrammarBuilderBase.cs
- PtsHost.cs
- XsdValidatingReader.cs
- QueryContinueDragEventArgs.cs
- RefreshEventArgs.cs
- PassportIdentity.cs
- typedescriptorpermissionattribute.cs
- IIS7UserPrincipal.cs
- GuidelineSet.cs
- NameValuePair.cs
- DocumentCollection.cs
- PropertyMappingExceptionEventArgs.cs
- LocalFileSettingsProvider.cs
- CreateUserWizardAutoFormat.cs
- WebPartMovingEventArgs.cs
- odbcmetadatacolumnnames.cs
- ClientRuntimeConfig.cs
- DateTimeConverter.cs
- ToolStripDropDownItem.cs
- SecureUICommand.cs
- RunInstallerAttribute.cs
- AdRotator.cs
- SerializationException.cs
- IisTraceListener.cs
- ZoneIdentityPermission.cs
- OuterGlowBitmapEffect.cs
- NumericExpr.cs
- OdbcConnectionStringbuilder.cs
- EventProviderWriter.cs
- DbgUtil.cs
- JsonStringDataContract.cs
- SqlClientWrapperSmiStream.cs
- WeakReferenceKey.cs
- CellLabel.cs
- HelpProvider.cs
- AttributeCollection.cs
- NameValueConfigurationCollection.cs
- DocumentApplicationJournalEntry.cs
- DesignTimeType.cs
- EventLogPermission.cs
- URL.cs
- StorageBasedPackageProperties.cs
- Translator.cs
- SQLBytes.cs
- TCPClient.cs
- UnsafePeerToPeerMethods.cs
- RequestQueue.cs
- HttpCookiesSection.cs
- CommandEventArgs.cs
- StringUtil.cs
- ToolBarPanel.cs
- ToolBarPanel.cs
- DataGridViewCellCancelEventArgs.cs
- BmpBitmapEncoder.cs
- GroupBoxDesigner.cs
- XmlSchemaInferenceException.cs
- DataGridViewTopLeftHeaderCell.cs
- ChtmlTextWriter.cs
- Vector3D.cs
- TextAutomationPeer.cs
- TextWriter.cs
- PeerToPeerException.cs
- VisualBasicReference.cs
- DataGridRowEventArgs.cs
- DbException.cs
- NumericUpDownAccelerationCollection.cs
- Viewport2DVisual3D.cs
- FixedPageStructure.cs