Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Description / DataContractSerializerMessageContractImporter.cs / 1 / DataContractSerializerMessageContractImporter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Description { using System; using System.ServiceModel.Channels; using System.Collections; using System.Collections.Generic; using System.Text; using System.ServiceModel; using System.Runtime.Serialization; using System.Xml; using System.Xml.Schema; using System.CodeDom; using WsdlNS = System.Web.Services.Description; using System.Xml.Serialization; public class DataContractSerializerMessageContractImporter : IWsdlImportExtension { bool enabled = true; const string GenericMessageSchemaTypeName = "MessageBody"; const string GenericMessageSchemaTypeNamespace = "http://schemas.microsoft.com/Message"; const string StreamBodySchemaTypeName = "StreamBody"; const string StreamBodySchemaTypeNamespace = GenericMessageSchemaTypeNamespace; static internal XmlQualifiedName GenericMessageTypeName = new XmlQualifiedName(GenericMessageSchemaTypeName, GenericMessageSchemaTypeNamespace); static internal XmlQualifiedName StreamBodyTypeName = new XmlQualifiedName(StreamBodySchemaTypeName, StreamBodySchemaTypeNamespace); void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext) { if (endpointContext == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("endpointContext")); if(enabled) MessageContractImporter.ImportMessageBinding(importer, endpointContext, typeof(MessageContractImporter.DataContractSerializerSchemaImporter)); } void IWsdlImportExtension.ImportContract(WsdlImporter importer, WsdlContractConversionContext contractContext) { if (contractContext == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("contractContext")); if (enabled) MessageContractImporter.ImportMessageContract(importer, contractContext, MessageContractImporter.DataContractSerializerSchemaImporter.Get(importer)); } void IWsdlImportExtension.BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments, XmlSchemaSet xmlSchemas, ICollectionpolicy) { } public bool Enabled { get { return this.enabled; } set { this.enabled = value; } } } public class XmlSerializerMessageContractImporter : IWsdlImportExtension { void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext) { if (endpointContext == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("endpointContext")); MessageContractImporter.ImportMessageBinding(importer, endpointContext, typeof(MessageContractImporter.XmlSerializerSchemaImporter)); } void IWsdlImportExtension.ImportContract(WsdlImporter importer, WsdlContractConversionContext contractContext) { if (contractContext == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("contractContext")); MessageContractImporter.ImportMessageContract(importer, contractContext, MessageContractImporter.XmlSerializerSchemaImporter.Get(importer)); } void IWsdlImportExtension.BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments, XmlSchemaSet xmlSchemas, ICollection policy) { } } } // 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
- PolyLineSegment.cs
- RoutedUICommand.cs
- Type.cs
- CommentEmitter.cs
- XmlTextAttribute.cs
- SystemWebCachingSectionGroup.cs
- RegistryDataKey.cs
- _ListenerAsyncResult.cs
- DBCSCodePageEncoding.cs
- RelationHandler.cs
- MemoryFailPoint.cs
- ProfileSection.cs
- GPStream.cs
- FrugalList.cs
- IPGlobalProperties.cs
- FlowDocumentPaginator.cs
- DetailsViewCommandEventArgs.cs
- ActivationArguments.cs
- AnnotationObservableCollection.cs
- ComponentDispatcherThread.cs
- OperatingSystem.cs
- ServiceContractDetailViewControl.cs
- StringAnimationBase.cs
- CollectionDataContract.cs
- GlyphManager.cs
- DataTableReaderListener.cs
- WorkflowViewStateService.cs
- RichTextBox.cs
- TypeDelegator.cs
- CopyOfAction.cs
- BuildManagerHost.cs
- Int32Rect.cs
- PropertyGridView.cs
- SqlTransaction.cs
- XmlNavigatorFilter.cs
- WebConfigManager.cs
- TableCellAutomationPeer.cs
- SqlConnectionString.cs
- DependencyPropertyKind.cs
- X509ChainPolicy.cs
- FormsAuthentication.cs
- RIPEMD160.cs
- WorkflowDesignerMessageFilter.cs
- invalidudtexception.cs
- TimestampInformation.cs
- ClientRoleProvider.cs
- BoundingRectTracker.cs
- AssemblyAttributesGoHere.cs
- ImageSource.cs
- BatchParser.cs
- Exception.cs
- ObjectDataSourceSelectingEventArgs.cs
- XmlUtilWriter.cs
- DesignerRegionCollection.cs
- AnnotationHighlightLayer.cs
- FolderBrowserDialog.cs
- mediaeventargs.cs
- KoreanLunisolarCalendar.cs
- HtmlInputSubmit.cs
- HttpApplication.cs
- PropertyDescriptor.cs
- HttpDigestClientCredential.cs
- BatchParser.cs
- HtmlInputImage.cs
- TraceXPathNavigator.cs
- ObjectReferenceStack.cs
- SignatureDescription.cs
- DataGridPagerStyle.cs
- CodeDelegateInvokeExpression.cs
- XmlCustomFormatter.cs
- ComboBox.cs
- SqlWorkflowInstanceStore.cs
- TypeExtensionConverter.cs
- CodeSnippetTypeMember.cs
- TraceContextRecord.cs
- SpeechDetectedEventArgs.cs
- DataListCommandEventArgs.cs
- FtpRequestCacheValidator.cs
- PartialCachingControl.cs
- BamlStream.cs
- HtmlTitle.cs
- PathBox.cs
- TextContainerChangedEventArgs.cs
- CodeGenerationManager.cs
- X509CertificateStore.cs
- MessageFormatterConverter.cs
- PublisherIdentityPermission.cs
- TransportConfigurationTypeElementCollection.cs
- DataGridViewTopRowAccessibleObject.cs
- Evidence.cs
- SystemUdpStatistics.cs
- ExpressionEditorAttribute.cs
- DefaultValueAttribute.cs
- XmlTextReader.cs
- ServerReliableChannelBinder.cs
- SmtpClient.cs
- TagPrefixCollection.cs
- _CookieModule.cs
- AnnotationObservableCollection.cs
- IdentityModelStringsVersion1.cs