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
- RefreshResponseInfo.cs
- ToolStripDropDown.cs
- XmlnsCompatibleWithAttribute.cs
- Pkcs7Signer.cs
- StringTraceRecord.cs
- FilterInvalidBodyAccessException.cs
- UIntPtr.cs
- ByteKeyFrameCollection.cs
- PropertyMetadata.cs
- PagePropertiesChangingEventArgs.cs
- HotSpotCollection.cs
- Globals.cs
- HostProtectionException.cs
- DuplicateDetector.cs
- NeutralResourcesLanguageAttribute.cs
- DeadCharTextComposition.cs
- PolyBezierSegment.cs
- BitmapEffect.cs
- XPathParser.cs
- RoleManagerSection.cs
- SizeAnimation.cs
- FlowNode.cs
- Int64Converter.cs
- MultiSelectRootGridEntry.cs
- TextBox.cs
- XmlArrayItemAttributes.cs
- TextParaLineResult.cs
- BoolExpressionVisitors.cs
- ManagedCodeMarkers.cs
- _SingleItemRequestCache.cs
- OleDbErrorCollection.cs
- AuthorizationSection.cs
- DummyDataSource.cs
- HMAC.cs
- XmlDataCollection.cs
- DispatcherTimer.cs
- Nodes.cs
- TextElement.cs
- XPathEmptyIterator.cs
- FastPropertyAccessor.cs
- FileRegion.cs
- Directory.cs
- BulletChrome.cs
- login.cs
- PropertyInformationCollection.cs
- Substitution.cs
- HostUtils.cs
- TokenFactoryFactory.cs
- OpenTypeLayout.cs
- CommandManager.cs
- AspNetSynchronizationContext.cs
- Profiler.cs
- RijndaelManagedTransform.cs
- KeyedQueue.cs
- PathData.cs
- BitmapCodecInfoInternal.cs
- AnonymousIdentificationModule.cs
- ZipIOBlockManager.cs
- DBPropSet.cs
- Vector3DAnimationUsingKeyFrames.cs
- DirectionalLight.cs
- DecoderNLS.cs
- XmlWrappingReader.cs
- ICollection.cs
- RootAction.cs
- ProtectedConfigurationProviderCollection.cs
- ActivityStatusChangeEventArgs.cs
- CustomCategoryAttribute.cs
- FrameworkContentElement.cs
- Helper.cs
- DefaultProxySection.cs
- DelegatingTypeDescriptionProvider.cs
- ParameterRefs.cs
- UnionExpr.cs
- DynamicDataManager.cs
- DynamicDocumentPaginator.cs
- KeyGestureValueSerializer.cs
- RuleSettingsCollection.cs
- WebBrowserProgressChangedEventHandler.cs
- DesignerWidgets.cs
- CdpEqualityComparer.cs
- PathGeometry.cs
- XmlNodeChangedEventArgs.cs
- ResolvedKeyFrameEntry.cs
- ResourceType.cs
- DbConnectionInternal.cs
- SerializationAttributes.cs
- NativeMethods.cs
- BrowserCapabilitiesFactory.cs
- ValueUnavailableException.cs
- DataBoundControl.cs
- BlurEffect.cs
- TrustLevelCollection.cs
- BaseCollection.cs
- SignatureDescription.cs
- PkcsMisc.cs
- UndoEngine.cs
- ExpressionBuilder.cs
- BuilderInfo.cs
- PassportIdentity.cs