Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / StandardBindingImporter.cs / 1 / StandardBindingImporter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Xml; using System.ServiceModel; using System.ServiceModel.Description; using System.Xml.Schema; using System.Collections.ObjectModel; using System.Collections.Generic; using WsdlNS=System.Web.Services.Description; public class StandardBindingImporter : IWsdlImportExtension { void IWsdlImportExtension.BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments, XmlSchemaSet xmlSchemas, ICollectionpolicy) { } void IWsdlImportExtension.ImportContract(WsdlImporter importer, WsdlContractConversionContext context) { } void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext) { if (endpointContext == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext"); #pragma warning suppress 56506 // [....], endpointContext.Endpoint is never null if (endpointContext.Endpoint.Binding == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext.Binding"); if (endpointContext.Endpoint.Binding is CustomBinding) { BindingElementCollection elements = ((CustomBinding)endpointContext.Endpoint.Binding).Elements; Binding binding; TransportBindingElement transport = elements.Find (); if (transport is HttpTransportBindingElement) { if (WSHttpBindingBase.TryCreate(elements, out binding)) { SetBinding(endpointContext.Endpoint, binding); } else if (WSDualHttpBinding.TryCreate(elements, out binding)) { SetBinding(endpointContext.Endpoint, binding); } else if (BasicHttpBinding.TryCreate(elements, out binding)) { SetBinding(endpointContext.Endpoint, binding); } } else if (transport is MsmqTransportBindingElement && NetMsmqBinding.TryCreate(elements, out binding)) { SetBinding(endpointContext.Endpoint, binding); } else if (transport is NamedPipeTransportBindingElement && NetNamedPipeBinding.TryCreate(elements, out binding)) { SetBinding(endpointContext.Endpoint, binding); } else if (transport is PeerTransportBindingElement && NetPeerTcpBinding.TryCreate(elements, out binding)) { SetBinding(endpointContext.Endpoint, binding); } else if (transport is TcpTransportBindingElement && NetTcpBinding.TryCreate(elements, out binding)) { SetBinding(endpointContext.Endpoint, binding); } } } void SetBinding(ServiceEndpoint endpoint, Binding binding) { binding.Name = endpoint.Binding.Name; binding.Namespace = endpoint.Binding.Namespace; endpoint.Binding = binding; } } } // 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
- RawStylusInputCustomDataList.cs
- HyperLinkColumn.cs
- CollectionView.cs
- BrowserDefinition.cs
- FlowNode.cs
- WrapperSecurityCommunicationObject.cs
- QfeChecker.cs
- DataGridViewDataErrorEventArgs.cs
- Table.cs
- ResourceReferenceKeyNotFoundException.cs
- DetailsView.cs
- SamlSerializer.cs
- TrackingMemoryStream.cs
- EmptyControlCollection.cs
- ParenthesizePropertyNameAttribute.cs
- BuildProvidersCompiler.cs
- DataPagerFieldCollection.cs
- ActivityDesignerLayoutSerializers.cs
- LabelDesigner.cs
- ListCollectionView.cs
- XmlSchemaExternal.cs
- CodeMemberEvent.cs
- PropertyTabChangedEvent.cs
- MulticastNotSupportedException.cs
- UnsafeNativeMethodsPenimc.cs
- TableLayoutColumnStyleCollection.cs
- DataPointer.cs
- BitmapEffectInputData.cs
- TypedTableBaseExtensions.cs
- ColumnResult.cs
- PrePostDescendentsWalker.cs
- DataGridDetailsPresenterAutomationPeer.cs
- FontCollection.cs
- GenericQueueSurrogate.cs
- GlobalItem.cs
- GridLengthConverter.cs
- _SpnDictionary.cs
- RegexTree.cs
- MobileErrorInfo.cs
- SystemColors.cs
- HttpProfileBase.cs
- FrameAutomationPeer.cs
- HScrollProperties.cs
- QilBinary.cs
- WmlTextBoxAdapter.cs
- ToolStripItemRenderEventArgs.cs
- IndexedString.cs
- Image.cs
- ModifyActivitiesPropertyDescriptor.cs
- ValidationPropertyAttribute.cs
- Canvas.cs
- ColorConvertedBitmap.cs
- IApplicationTrustManager.cs
- HotCommands.cs
- PaperSize.cs
- EventlogProvider.cs
- HtmlUtf8RawTextWriter.cs
- ThicknessAnimation.cs
- MemoryStream.cs
- BigInt.cs
- PrinterResolution.cs
- TrackPointCollection.cs
- AdornedElementPlaceholder.cs
- FrameworkContentElementAutomationPeer.cs
- FormsAuthenticationEventArgs.cs
- KeyValuePair.cs
- SelectionProviderWrapper.cs
- SchemeSettingElement.cs
- PathTooLongException.cs
- PermissionSetTriple.cs
- TemplatePropertyEntry.cs
- FontDifferentiator.cs
- Variant.cs
- ZipIOCentralDirectoryFileHeader.cs
- LogReserveAndAppendState.cs
- AnnotationHelper.cs
- DataRowExtensions.cs
- MasterPageParser.cs
- ViewGenResults.cs
- SubtreeProcessor.cs
- RegexWriter.cs
- _ListenerRequestStream.cs
- DataGridView.cs
- SizeFConverter.cs
- BitmapEncoder.cs
- ConnectivityStatus.cs
- ControlParameter.cs
- XsltLoader.cs
- ClientUtils.cs
- ECDsa.cs
- Graphics.cs
- BorderGapMaskConverter.cs
- TypeToStringValueConverter.cs
- MetaDataInfo.cs
- KeyProperty.cs
- SafeCryptoHandles.cs
- ObjectToken.cs
- RegexTypeEditor.cs
- SafeNativeMethods.cs
- ToolStripScrollButton.cs