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
- UnauthorizedAccessException.cs
- DropShadowEffect.cs
- EdmComplexTypeAttribute.cs
- ProfileSettingsCollection.cs
- EllipseGeometry.cs
- ScaleTransform.cs
- LogLogRecordEnumerator.cs
- EventToken.cs
- FormsAuthenticationTicket.cs
- AttributeParameterInfo.cs
- StringUtil.cs
- OledbConnectionStringbuilder.cs
- DbProviderSpecificTypePropertyAttribute.cs
- Visual3D.cs
- TextTreeNode.cs
- AuthenticationSection.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- SrgsSubset.cs
- CompilerCollection.cs
- DocumentGridPage.cs
- Unit.cs
- RSAPKCS1SignatureDeformatter.cs
- DesignTimeVisibleAttribute.cs
- SortExpressionBuilder.cs
- ToolBarOverflowPanel.cs
- _Events.cs
- Span.cs
- StringFreezingAttribute.cs
- _LocalDataStoreMgr.cs
- AssemblyUtil.cs
- AddInServer.cs
- GridViewUpdatedEventArgs.cs
- Attachment.cs
- BuiltInExpr.cs
- RepeatInfo.cs
- Rotation3DAnimation.cs
- Documentation.cs
- HttpsHostedTransportConfiguration.cs
- RenderDataDrawingContext.cs
- NameValueFileSectionHandler.cs
- Claim.cs
- Vector3DIndependentAnimationStorage.cs
- WindowsPrincipal.cs
- ServiceDescriptionContext.cs
- CompositeDataBoundControl.cs
- XsltInput.cs
- GetWinFXPath.cs
- QilGenerator.cs
- TypeConverterMarkupExtension.cs
- PackageRelationshipSelector.cs
- StyleSelector.cs
- TimelineClockCollection.cs
- XmlWriter.cs
- TimeSpan.cs
- PageContentCollection.cs
- DependencyPropertyValueSerializer.cs
- ManagementObjectSearcher.cs
- VerticalAlignConverter.cs
- login.cs
- Baml2006Reader.cs
- AsyncSerializedWorker.cs
- XmlNodeChangedEventArgs.cs
- RNGCryptoServiceProvider.cs
- DataGridViewTextBoxCell.cs
- RTLAwareMessageBox.cs
- Binding.cs
- KoreanLunisolarCalendar.cs
- InvokeMethod.cs
- SelectionEditingBehavior.cs
- ObjectSet.cs
- SaveFileDialog.cs
- StylusOverProperty.cs
- RegexCharClass.cs
- SimpleHandlerBuildProvider.cs
- Visual3D.cs
- MetadataArtifactLoaderResource.cs
- MultiBindingExpression.cs
- bindurihelper.cs
- CopyCodeAction.cs
- ResourceReader.cs
- LongTypeConverter.cs
- AddInServer.cs
- backend.cs
- TrackingProfileDeserializationException.cs
- InvalidateEvent.cs
- _AutoWebProxyScriptHelper.cs
- PropertyGridView.cs
- Timer.cs
- Pair.cs
- DrawingVisual.cs
- ClassDataContract.cs
- CustomAssemblyResolver.cs
- CodeCompileUnit.cs
- ModuleElement.cs
- StorageComplexTypeMapping.cs
- EventBuilder.cs
- DataDocumentXPathNavigator.cs
- MdiWindowListStrip.cs
- UIServiceHelper.cs
- NamedPipeTransportSecurity.cs