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
- DBBindings.cs
- WebPartVerbsEventArgs.cs
- RtfToken.cs
- EntityEntry.cs
- DataSvcMapFile.cs
- DataGridTablesFactory.cs
- ToolStripSeparator.cs
- TreeView.cs
- MetaModel.cs
- EditingScopeUndoUnit.cs
- Attachment.cs
- OrderedEnumerableRowCollection.cs
- XmlReflectionMember.cs
- UserControlFileEditor.cs
- FixedBufferAttribute.cs
- TextContainerHelper.cs
- WebServiceParameterData.cs
- HostedHttpContext.cs
- XmlNullResolver.cs
- SafeSystemMetrics.cs
- XmlSchemaSequence.cs
- Delay.cs
- ParenthesizePropertyNameAttribute.cs
- Vector3DAnimation.cs
- ExpressionCopier.cs
- DataGridToolTip.cs
- ProviderIncompatibleException.cs
- EventHandlersStore.cs
- DataGridTableStyleMappingNameEditor.cs
- PrimitiveType.cs
- WebPartConnectionsCancelVerb.cs
- CacheMemory.cs
- RenderContext.cs
- CodeDOMProvider.cs
- BindingExpressionUncommonField.cs
- ScriptingJsonSerializationSection.cs
- VirtualizedContainerService.cs
- CacheChildrenQuery.cs
- AppModelKnownContentFactory.cs
- FileInfo.cs
- RotateTransform3D.cs
- StylusPointDescription.cs
- sqlpipe.cs
- DbProviderManifest.cs
- ServiceDescriptionReflector.cs
- DiagnosticsConfigurationHandler.cs
- SourceFileInfo.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- MouseGesture.cs
- ActivityCompletionCallbackWrapper.cs
- SpellerStatusTable.cs
- DetailsViewAutoFormat.cs
- TextEditorCharacters.cs
- WebBrowserProgressChangedEventHandler.cs
- TypeBinaryExpression.cs
- XPathArrayIterator.cs
- WebEncodingValidatorAttribute.cs
- XmlIlGenerator.cs
- SamlSecurityToken.cs
- ScopeElement.cs
- AutomationTextAttribute.cs
- Activator.cs
- ScriptControlDescriptor.cs
- EnumDataContract.cs
- DesignerDataStoredProcedure.cs
- XmlSchema.cs
- ToolStripSeparatorRenderEventArgs.cs
- RegistryPermission.cs
- FormViewPagerRow.cs
- PrintEvent.cs
- UInt32.cs
- ObjectItemCollection.cs
- SafeFindHandle.cs
- DataControlLinkButton.cs
- UpdatePanelTrigger.cs
- sortedlist.cs
- pingexception.cs
- Event.cs
- versioninfo.cs
- PropertyDescriptor.cs
- SqlConnectionPoolProviderInfo.cs
- DataRecordInfo.cs
- UrlMappingsModule.cs
- FromReply.cs
- Stylus.cs
- DefaultConfirmation.cs
- PaintEvent.cs
- CmsInterop.cs
- MenuAdapter.cs
- HebrewNumber.cs
- EventItfInfo.cs
- DurationConverter.cs
- TextSelectionProcessor.cs
- IgnoreDeviceFilterElement.cs
- SQLResource.cs
- WindowsGraphicsCacheManager.cs
- InstanceData.cs
- NullableConverter.cs
- UserControlCodeDomTreeGenerator.cs
- WsdlBuildProvider.cs