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
- ProcessInfo.cs
- DataGrid.cs
- SqlErrorCollection.cs
- BamlBinaryReader.cs
- InputElement.cs
- TableCellAutomationPeer.cs
- ReadOnlyHierarchicalDataSource.cs
- ServiceReference.cs
- SelectorAutomationPeer.cs
- WorkflowMessageEventHandler.cs
- ScriptServiceAttribute.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- SafeRegistryHandle.cs
- PathStreamGeometryContext.cs
- ReferenceCountedObject.cs
- VariableAction.cs
- BuildResult.cs
- BindingGraph.cs
- CompositionAdorner.cs
- NodeFunctions.cs
- HttpPostedFile.cs
- SqlTriggerContext.cs
- MouseGestureConverter.cs
- BitmapSourceSafeMILHandle.cs
- PeerReferralPolicy.cs
- EntityParameter.cs
- IdnElement.cs
- CTreeGenerator.cs
- ObjectMemberMapping.cs
- NativeMsmqMessage.cs
- HttpCookie.cs
- HtmlEncodedRawTextWriter.cs
- PaintEvent.cs
- AlphabeticalEnumConverter.cs
- SerializationInfoEnumerator.cs
- GridEntryCollection.cs
- UrlMappingsModule.cs
- LocalizedNameDescriptionPair.cs
- TreeChangeInfo.cs
- String.cs
- TextElementEditingBehaviorAttribute.cs
- CacheDependency.cs
- TargetConverter.cs
- FreeFormPanel.cs
- SoapCommonClasses.cs
- RoutingTable.cs
- RemotingConfigParser.cs
- WebMessageEncoderFactory.cs
- InvokeMemberBinder.cs
- WinHttpWebProxyFinder.cs
- TextDecorationCollectionConverter.cs
- SystemIPv4InterfaceProperties.cs
- Odbc32.cs
- OptimalTextSource.cs
- SystemWebCachingSectionGroup.cs
- FixUp.cs
- BulletedList.cs
- ProtocolElement.cs
- WpfWebRequestHelper.cs
- SqlDependencyListener.cs
- OLEDB_Enum.cs
- ListenerElementsCollection.cs
- AddressHeaderCollection.cs
- Timeline.cs
- DeleteHelper.cs
- HttpHandler.cs
- OrderablePartitioner.cs
- CorrelationTokenInvalidatedHandler.cs
- ExpressionHelper.cs
- remotingproxy.cs
- QueryStringHandler.cs
- SqlSelectStatement.cs
- StylusPointPropertyInfo.cs
- SendKeys.cs
- CriticalHandle.cs
- PolicyValidationException.cs
- XAMLParseException.cs
- SectionRecord.cs
- StaticContext.cs
- FontNamesConverter.cs
- IndexerNameAttribute.cs
- WindowsPen.cs
- TreeNodeStyleCollection.cs
- FindCriteriaElement.cs
- LineServicesCallbacks.cs
- SQLInt32Storage.cs
- SafeNativeMethods.cs
- Thumb.cs
- PackagePartCollection.cs
- XmlSchemaElement.cs
- ZipPackagePart.cs
- ITreeGenerator.cs
- ProfilePropertySettingsCollection.cs
- listviewsubitemcollectioneditor.cs
- XhtmlBasicFormAdapter.cs
- XmlCharCheckingReader.cs
- DataGridViewHeaderCell.cs
- FloatUtil.cs
- WebPartHelpVerb.cs
- DefaultBinder.cs