Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Description / WsdlContractConversionContext.cs / 2 / WsdlContractConversionContext.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Description { using System.Xml; using System.ServiceModel.Channels; using System.Xml.Schema; using System.Collections.Generic; using System.Collections.ObjectModel; using WsdlNS = System.Web.Services.Description; // This class is created as part of the export process and passed to // Wsdlmporter and WsdlExporter implementations as a utility for // Correlating between the WSDL OM and the Indigo OM // in the conversion process. public class WsdlContractConversionContext { readonly ContractDescription contract; readonly WsdlNS.PortType wsdlPortType; readonly DictionarywsdlOperations; readonly Dictionary operationDescriptions; readonly Dictionary wsdlOperationMessages; readonly Dictionary wsdlOperationFaults; readonly Dictionary messageDescriptions; readonly Dictionary faultDescriptions; readonly Dictionary > operationBindings; internal WsdlContractConversionContext(ContractDescription contract, WsdlNS.PortType wsdlPortType) { this.contract = contract; this.wsdlPortType = wsdlPortType; this.wsdlOperations = new Dictionary (); this.operationDescriptions = new Dictionary (); this.wsdlOperationMessages = new Dictionary (); this.messageDescriptions = new Dictionary (); this.wsdlOperationFaults = new Dictionary (); this.faultDescriptions = new Dictionary (); this.operationBindings = new Dictionary >(); } internal IEnumerable ExportExtensions { get { foreach (IWsdlExportExtension extension in contract.Behaviors.FindAll ()) { yield return extension; } foreach (OperationDescription operation in contract.Operations) { if (!WsdlExporter.OperationIsExportable(operation)) { continue; } // In 3.0SP1, the DCSOB and XSOB were moved from before to after the custom behaviors. For // IWsdlExportExtension compat, run them in the pre-SP1 order. // TEF QFE 367607 Collection extensions = operation.Behaviors.FindAll (); for (int i = 0; i < extensions.Count;) { if (WsdlExporter.IsBuiltInOperationBehavior(extensions[i])) { yield return extensions[i]; extensions.RemoveAt(i); } else { i++; } } foreach (IWsdlExportExtension extension in extensions) { yield return extension; } } } } public ContractDescription Contract { get { return contract; } } public WsdlNS.PortType WsdlPortType { get { return wsdlPortType; } } public WsdlNS.Operation GetOperation(OperationDescription operation) { return this.wsdlOperations[operation]; } public WsdlNS.OperationMessage GetOperationMessage(MessageDescription message) { return this.wsdlOperationMessages[message]; } public WsdlNS.OperationFault GetOperationFault(FaultDescription fault) { return this.wsdlOperationFaults[fault]; } public OperationDescription GetOperationDescription(WsdlNS.Operation operation) { return this.operationDescriptions[operation]; } public MessageDescription GetMessageDescription(WsdlNS.OperationMessage operationMessage) { return this.messageDescriptions[operationMessage]; } public FaultDescription GetFaultDescription(WsdlNS.OperationFault operationFault) { return this.faultDescriptions[operationFault]; } // ------------------------------------------------------------------------------------------------- internal void AddOperation(OperationDescription operationDescription, WsdlNS.Operation wsdlOperation) { this.wsdlOperations.Add(operationDescription, wsdlOperation); this.operationDescriptions.Add(wsdlOperation, operationDescription); } internal void AddMessage(MessageDescription messageDescription, WsdlNS.OperationMessage wsdlOperationMessage) { this.wsdlOperationMessages.Add(messageDescription, wsdlOperationMessage); this.messageDescriptions.Add(wsdlOperationMessage, messageDescription); } internal void AddFault(FaultDescription faultDescription, WsdlNS.OperationFault wsdlOperationFault) { this.wsdlOperationFaults.Add(faultDescription, wsdlOperationFault); this.faultDescriptions.Add(wsdlOperationFault, faultDescription); } internal Collection GetOperationBindings(WsdlNS.Operation operation) { Collection bindings; if (!this.operationBindings.TryGetValue(operation, out bindings)) { bindings = new Collection (); WsdlNS.ServiceDescriptionCollection wsdlDocuments = WsdlPortType.ServiceDescription.ServiceDescriptions; foreach (WsdlNS.ServiceDescription wsdl in wsdlDocuments) { foreach (WsdlNS.Binding wsdlBinding in wsdl.Bindings) { if (wsdlBinding.Type.Name == WsdlPortType.Name && wsdlBinding.Type.Namespace == WsdlPortType.ServiceDescription.TargetNamespace) { foreach (WsdlNS.OperationBinding operationBinding in wsdlBinding.Operations) { if (operationBinding.Name == operation.Name && WsdlImporter.Binding2DescriptionHelper.IsOperationBoundBy(operationBinding, operation)) { bindings.Add(operationBinding); break; } } } } } this.operationBindings.Add(operation, bindings); } return bindings; } } } // 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
- CryptoConfig.cs
- DeadCharTextComposition.cs
- ipaddressinformationcollection.cs
- CodeSubDirectoriesCollection.cs
- ImageFormatConverter.cs
- InstanceNotFoundException.cs
- FixedDSBuilder.cs
- SessionStateContainer.cs
- ImageSourceConverter.cs
- XamlClipboardData.cs
- GridViewRowCollection.cs
- PageAsyncTaskManager.cs
- NetSectionGroup.cs
- base64Transforms.cs
- XmlEntity.cs
- StringCollection.cs
- DataGridColumnHeaderCollection.cs
- UIElementPropertyUndoUnit.cs
- DataColumnMapping.cs
- MatrixTransform3D.cs
- Point4D.cs
- Matrix.cs
- IOThreadTimer.cs
- PointAnimationClockResource.cs
- DetailsViewCommandEventArgs.cs
- MediaElementAutomationPeer.cs
- SimpleWorkerRequest.cs
- ImmutableObjectAttribute.cs
- SliderAutomationPeer.cs
- ListBindingHelper.cs
- SqlServer2KCompatibilityAnnotation.cs
- AdornerLayer.cs
- StopStoryboard.cs
- FrameworkRichTextComposition.cs
- _Rfc2616CacheValidators.cs
- ToggleProviderWrapper.cs
- DetailsViewDeleteEventArgs.cs
- TextRangeEditLists.cs
- HashAlgorithm.cs
- cookiecontainer.cs
- AmbientLight.cs
- WorkBatch.cs
- WindowsEditBox.cs
- ClientCultureInfo.cs
- NameTable.cs
- WindowsStartMenu.cs
- LocalizedNameDescriptionPair.cs
- PopupRoot.cs
- DataQuery.cs
- TimeManager.cs
- NavigationPropertyEmitter.cs
- SqlExpressionNullability.cs
- Page.cs
- MembershipSection.cs
- ToolStripLabel.cs
- MouseGestureValueSerializer.cs
- SqlExpander.cs
- CodeChecksumPragma.cs
- StreamUpdate.cs
- ClientConfigurationHost.cs
- KoreanLunisolarCalendar.cs
- WrapPanel.cs
- MetafileHeaderWmf.cs
- WebServiceResponseDesigner.cs
- CodeAttachEventStatement.cs
- CryptographicAttribute.cs
- TextParaClient.cs
- StrongNameMembershipCondition.cs
- XmlSerializerSection.cs
- LabelDesigner.cs
- __Filters.cs
- BuildProviderUtils.cs
- Form.cs
- FormatException.cs
- WebScriptMetadataMessage.cs
- ScrollableControl.cs
- MessageBox.cs
- PersonalizationEntry.cs
- QilFactory.cs
- SqlProvider.cs
- CngAlgorithmGroup.cs
- RadialGradientBrush.cs
- OSFeature.cs
- ListViewInsertEventArgs.cs
- PerformanceCounterManager.cs
- SR.cs
- LayoutTableCell.cs
- FontNamesConverter.cs
- PlanCompilerUtil.cs
- DataSourceListEditor.cs
- Sql8ExpressionRewriter.cs
- SafeNativeMethods.cs
- LazyLoadBehavior.cs
- ParameterToken.cs
- log.cs
- UnmanagedMarshal.cs
- InvalidWMPVersionException.cs
- QuestionEventArgs.cs
- IPipelineRuntime.cs
- precedingquery.cs