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
- VBCodeProvider.cs
- SoapMessage.cs
- DocumentOrderComparer.cs
- MetadataCache.cs
- _FtpControlStream.cs
- SecUtil.cs
- DependencyObject.cs
- TypeDescriptor.cs
- XmlSerializationWriter.cs
- FormattedTextSymbols.cs
- X509SecurityTokenAuthenticator.cs
- SiblingIterators.cs
- MatrixCamera.cs
- Cell.cs
- SerializationInfo.cs
- UTF8Encoding.cs
- SdlChannelSink.cs
- TextTrailingWordEllipsis.cs
- FileAuthorizationModule.cs
- PathSegmentCollection.cs
- QilInvokeEarlyBound.cs
- BaseAppDomainProtocolHandler.cs
- SystemDropShadowChrome.cs
- WebBrowserNavigatingEventHandler.cs
- StatementContext.cs
- EdmRelationshipRoleAttribute.cs
- MultitargetingHelpers.cs
- ColumnClickEvent.cs
- GeneralTransformGroup.cs
- MenuStrip.cs
- PersonalizationStateInfoCollection.cs
- Message.cs
- input.cs
- MemberRelationshipService.cs
- DataGridDetailsPresenterAutomationPeer.cs
- ButtonStandardAdapter.cs
- XmlBinaryReader.cs
- HttpListenerResponse.cs
- SimpleBitVector32.cs
- HTTPRemotingHandler.cs
- CompileXomlTask.cs
- LiteralControl.cs
- StdValidatorsAndConverters.cs
- IIS7WorkerRequest.cs
- CellQuery.cs
- StickyNoteHelper.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- XpsSerializationManager.cs
- AttributedMetaModel.cs
- UpdatePanelTriggerCollection.cs
- SecurityContext.cs
- ProxyElement.cs
- PointCollectionValueSerializer.cs
- HtmlSelect.cs
- DuplexChannelFactory.cs
- QuaternionRotation3D.cs
- Grid.cs
- SliderAutomationPeer.cs
- ConstructorNeedsTagAttribute.cs
- DataControlLinkButton.cs
- IntPtr.cs
- ListViewGroup.cs
- DataGridViewImageCell.cs
- SafeRegistryHandle.cs
- FileDetails.cs
- TableItemStyle.cs
- ILGenerator.cs
- MetadataWorkspace.cs
- ADConnectionHelper.cs
- PackagePart.cs
- ManagedIStream.cs
- DataColumnChangeEvent.cs
- OutputCacheModule.cs
- GreenMethods.cs
- COAUTHINFO.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- FileVersion.cs
- X509ChainElement.cs
- DesignerView.Commands.cs
- StateInitialization.cs
- PerspectiveCamera.cs
- LOSFormatter.cs
- DataSourceView.cs
- SvcMapFile.cs
- ServiceBehaviorAttribute.cs
- ViewBox.cs
- Rijndael.cs
- WebPartConnectionsCancelEventArgs.cs
- ResourceKey.cs
- CompoundFileIOPermission.cs
- FixedSOMLineRanges.cs
- NullReferenceException.cs
- SBCSCodePageEncoding.cs
- RectangleHotSpot.cs
- EditingCommands.cs
- HttpClientChannel.cs
- IBuiltInEvidence.cs
- TreeViewItemAutomationPeer.cs
- GridSplitter.cs
- TabletCollection.cs