Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Web / System / Web / Services / Description / MimeXmlReflector.cs / 1305376 / MimeXmlReflector.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Services.Description { using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Serialization; using System.Xml.Schema; using System.Collections; using System; using System.Reflection; using System.Xml; internal class MimeXmlReflector : MimeReflector { internal override bool ReflectParameters() { return false; } internal override bool ReflectReturn() { MessagePart part = new MessagePart(); part.Name = "Body"; ReflectionContext.OutputMessage.Parts.Add(part); if (typeof(XmlNode).IsAssignableFrom(ReflectionContext.Method.ReturnType)) { MimeContentBinding mimeContentBinding = new MimeContentBinding(); mimeContentBinding.Type = "text/xml"; mimeContentBinding.Part = part.Name; ReflectionContext.OperationBinding.Output.Extensions.Add(mimeContentBinding); } else { MimeXmlBinding mimeXmlBinding = new MimeXmlBinding(); mimeXmlBinding.Part = part.Name; LogicalMethodInfo methodInfo = ReflectionContext.Method; XmlAttributes a = new XmlAttributes(methodInfo.ReturnTypeCustomAttributeProvider); XmlTypeMapping xmlTypeMapping = ReflectionContext.ReflectionImporter.ImportTypeMapping(methodInfo.ReturnType, a.XmlRoot); xmlTypeMapping.SetKey(methodInfo.GetKey() + ":Return"); ReflectionContext.SchemaExporter.ExportTypeMapping(xmlTypeMapping); part.Element = new XmlQualifiedName(xmlTypeMapping.XsdElementName, xmlTypeMapping.Namespace); ReflectionContext.OperationBinding.Output.Extensions.Add(mimeXmlBinding); } return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Services.Description { using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Serialization; using System.Xml.Schema; using System.Collections; using System; using System.Reflection; using System.Xml; internal class MimeXmlReflector : MimeReflector { internal override bool ReflectParameters() { return false; } internal override bool ReflectReturn() { MessagePart part = new MessagePart(); part.Name = "Body"; ReflectionContext.OutputMessage.Parts.Add(part); if (typeof(XmlNode).IsAssignableFrom(ReflectionContext.Method.ReturnType)) { MimeContentBinding mimeContentBinding = new MimeContentBinding(); mimeContentBinding.Type = "text/xml"; mimeContentBinding.Part = part.Name; ReflectionContext.OperationBinding.Output.Extensions.Add(mimeContentBinding); } else { MimeXmlBinding mimeXmlBinding = new MimeXmlBinding(); mimeXmlBinding.Part = part.Name; LogicalMethodInfo methodInfo = ReflectionContext.Method; XmlAttributes a = new XmlAttributes(methodInfo.ReturnTypeCustomAttributeProvider); XmlTypeMapping xmlTypeMapping = ReflectionContext.ReflectionImporter.ImportTypeMapping(methodInfo.ReturnType, a.XmlRoot); xmlTypeMapping.SetKey(methodInfo.GetKey() + ":Return"); ReflectionContext.SchemaExporter.ExportTypeMapping(xmlTypeMapping); part.Element = new XmlQualifiedName(xmlTypeMapping.XsdElementName, xmlTypeMapping.Namespace); ReflectionContext.OperationBinding.Output.Extensions.Add(mimeXmlBinding); } return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IApplicationTrustManager.cs
- HtmlSelect.cs
- Semaphore.cs
- CriticalFinalizerObject.cs
- ControlDesigner.cs
- XamlBuildTaskServices.cs
- FileInfo.cs
- ValuePatternIdentifiers.cs
- BitHelper.cs
- PrivacyNoticeBindingElementImporter.cs
- GroupBox.cs
- CacheDict.cs
- SimpleTypeResolver.cs
- DetailsViewAutoFormat.cs
- EnumerationRangeValidationUtil.cs
- DockPanel.cs
- FileLevelControlBuilderAttribute.cs
- InputLanguage.cs
- DbConnectionInternal.cs
- DrawingAttributeSerializer.cs
- DirectoryInfo.cs
- UrlPropertyAttribute.cs
- ByValueEqualityComparer.cs
- TextLine.cs
- DirectoryNotFoundException.cs
- DivideByZeroException.cs
- OpacityConverter.cs
- DrawingBrush.cs
- MouseGestureConverter.cs
- ListBox.cs
- FileNameEditor.cs
- MarkupCompilePass1.cs
- GenerateTemporaryTargetAssembly.cs
- SoapReflectionImporter.cs
- Pair.cs
- MediaCommands.cs
- TrackingMemoryStream.cs
- HasCopySemanticsAttribute.cs
- SecurityAlgorithmSuiteConverter.cs
- RuntimeArgumentHandle.cs
- RowBinding.cs
- Int32Converter.cs
- HintTextConverter.cs
- NumericUpDownAccelerationCollection.cs
- TracedNativeMethods.cs
- UseManagedPresentationBindingElement.cs
- ReferencedCollectionType.cs
- FrameworkObject.cs
- AuthenticationConfig.cs
- ErrorProvider.cs
- ScaleTransform3D.cs
- DoubleCollection.cs
- IMembershipProvider.cs
- CollectionViewProxy.cs
- COM2IPerPropertyBrowsingHandler.cs
- COM2FontConverter.cs
- InputLanguageManager.cs
- SafeFindHandle.cs
- EmbeddedObject.cs
- TextEditorSelection.cs
- XmlSchemaCollection.cs
- GridViewItemAutomationPeer.cs
- ObjectListShowCommandsEventArgs.cs
- StringExpressionSet.cs
- SvcFileManager.cs
- CodeCatchClauseCollection.cs
- DocumentViewerHelper.cs
- ModelVisual3D.cs
- SmtpAuthenticationManager.cs
- UpdateDelegates.Generated.cs
- ToolStripItemTextRenderEventArgs.cs
- CqlGenerator.cs
- HtmlValidatorAdapter.cs
- ErrorCodes.cs
- HMACSHA1.cs
- ExtensionQuery.cs
- ConfigurationSettings.cs
- xmlfixedPageInfo.cs
- TypeDescriptionProviderAttribute.cs
- HttpHandlerActionCollection.cs
- PhysicalFontFamily.cs
- Bitmap.cs
- Path.cs
- arc.cs
- SequenceFullException.cs
- DropTarget.cs
- BitSet.cs
- ParserContext.cs
- AttributeAction.cs
- MethodAccessException.cs
- SimpleRecyclingCache.cs
- WsatConfiguration.cs
- LinqDataSourceInsertEventArgs.cs
- FontStyleConverter.cs
- DataServiceRequestException.cs
- NativeMethods.cs
- _NegoState.cs
- FileLevelControlBuilderAttribute.cs
- Invariant.cs
- DataKey.cs