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
- ServicePoint.cs
- FileUtil.cs
- DataControlFieldsEditor.cs
- URLIdentityPermission.cs
- SearchForVirtualItemEventArgs.cs
- Selection.cs
- Rotation3DAnimationUsingKeyFrames.cs
- PreloadedPackages.cs
- DataServiceKeyAttribute.cs
- GenericRootAutomationPeer.cs
- SecurityTokenAuthenticator.cs
- ColorAnimationBase.cs
- TypeGeneratedEventArgs.cs
- TextElementAutomationPeer.cs
- ClientSettingsStore.cs
- FullTrustAssembliesSection.cs
- StateWorkerRequest.cs
- ObjectListItemCollection.cs
- DesignerTransaction.cs
- DataGridViewCellLinkedList.cs
- FileRecordSequenceHelper.cs
- VisualStyleInformation.cs
- Delegate.cs
- NetworkAddressChange.cs
- StringBuilder.cs
- RelatedPropertyManager.cs
- PeerCollaborationPermission.cs
- UnsafeNativeMethods.cs
- NativeWindow.cs
- TemplateBamlRecordReader.cs
- ValueProviderWrapper.cs
- InstalledFontCollection.cs
- Propagator.Evaluator.cs
- BuildProviderAppliesToAttribute.cs
- EventProviderWriter.cs
- ExecutorLocksHeldException.cs
- InsufficientExecutionStackException.cs
- RawMouseInputReport.cs
- Rotation3DAnimation.cs
- TextEffectCollection.cs
- TabletDeviceInfo.cs
- TextTreeFixupNode.cs
- EntityDataSourceUtil.cs
- Focus.cs
- DocumentViewer.cs
- GetPageCompletedEventArgs.cs
- WorkItem.cs
- SliderAutomationPeer.cs
- EditingCommands.cs
- Lease.cs
- XomlCompilerHelpers.cs
- uribuilder.cs
- LazyTextWriterCreator.cs
- DataRowCollection.cs
- TableHeaderCell.cs
- DataSourceHelper.cs
- ExcCanonicalXml.cs
- SimpleRecyclingCache.cs
- PreApplicationStartMethodAttribute.cs
- DataControlCommands.cs
- HandlerBase.cs
- ManagementQuery.cs
- MergeLocalizationDirectives.cs
- DataExpression.cs
- IdentityModelStringsVersion1.cs
- FacetValueContainer.cs
- TemplateBindingExpression.cs
- ComponentGuaranteesAttribute.cs
- UnsafeNativeMethods.cs
- DocumentApplicationJournalEntry.cs
- TypeResolver.cs
- InterleavedZipPartStream.cs
- Hashtable.cs
- CommandCollectionEditor.cs
- LicenseException.cs
- FixedSOMLineRanges.cs
- DataGridCommandEventArgs.cs
- SortedDictionary.cs
- CodeTypeReference.cs
- SqlCommandSet.cs
- EncryptedKeyIdentifierClause.cs
- EntityDataReader.cs
- DocobjHost.cs
- JournalEntryListConverter.cs
- PageClientProxyGenerator.cs
- PenThread.cs
- ConstructorBuilder.cs
- StoreConnection.cs
- CommandID.cs
- SmtpDigestAuthenticationModule.cs
- CharacterMetricsDictionary.cs
- ComponentCodeDomSerializer.cs
- FreezableOperations.cs
- SafeNativeMethodsOther.cs
- TripleDESCryptoServiceProvider.cs
- LocalIdKeyIdentifierClause.cs
- DbReferenceCollection.cs
- TriggerCollection.cs
- EmptyQuery.cs
- ObjectPropertyMapping.cs