Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Dispatcher / DemultiplexingClientMessageFormatter.cs / 1 / DemultiplexingClientMessageFormatter.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Dispatcher { using System; using System.Collections.Generic; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.Globalization; class DemultiplexingClientMessageFormatter : IClientMessageFormatter { IClientMessageFormatter defaultFormatter; Dictionaryformatters; string supportedFormats; public DemultiplexingClientMessageFormatter(IDictionary formatters, IClientMessageFormatter defaultFormatter) { if (formatters == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("formatters"); } this.formatters = new Dictionary (); foreach (WebContentFormat key in formatters.Keys) { this.formatters.Add(key, formatters[key]); } this.defaultFormatter = defaultFormatter; } public object DeserializeReply(Message message, object[] parameters) { if (message == null) { return null; } WebContentFormat format; IClientMessageFormatter selectedFormatter; if (DemultiplexingDispatchMessageFormatter.TryGetEncodingFormat(message, out format)) { this.formatters.TryGetValue(format, out selectedFormatter); if (selectedFormatter == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(new InvalidOperationException(SR2.GetString(SR2.UnrecognizedHttpMessageFormat, format, GetSupportedFormats()))); } } else { selectedFormatter = this.defaultFormatter; if (selectedFormatter == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(new InvalidOperationException(SR2.GetString(SR2.MessageFormatPropertyNotFound3))); } } return selectedFormatter.DeserializeReply(message, parameters); } public Message SerializeRequest(MessageVersion messageVersion, object[] parameters) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR2.GetString(SR2.SerializingRequestNotSupportedByFormatter, this))); } string GetSupportedFormats() { if (this.supportedFormats == null) { this.supportedFormats = DemultiplexingDispatchMessageFormatter.GetSupportedFormats(this.formatters.Keys); } return this.supportedFormats; } } } // 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
- MatcherBuilder.cs
- backend.cs
- BaseDataListActionList.cs
- Converter.cs
- Int32CollectionConverter.cs
- ManagementBaseObject.cs
- PackageRelationship.cs
- ImageDrawing.cs
- TypedRowGenerator.cs
- SqlProviderServices.cs
- WindowsListViewScroll.cs
- MetadataCache.cs
- ForceCopyBuildProvider.cs
- InstanceStore.cs
- ByteConverter.cs
- MsmqIntegrationChannelListener.cs
- HttpContextServiceHost.cs
- DataKey.cs
- Parallel.cs
- FilterQuery.cs
- ProfileSettings.cs
- XPathNodeList.cs
- RegistrySecurity.cs
- PropertyState.cs
- UTF8Encoding.cs
- Calendar.cs
- OutOfMemoryException.cs
- QilList.cs
- BlockingCollection.cs
- ResourceManager.cs
- SubclassTypeValidator.cs
- PageAdapter.cs
- TabControl.cs
- XdrBuilder.cs
- BackgroundWorker.cs
- TabControlCancelEvent.cs
- ReferenceSchema.cs
- SmtpReplyReaderFactory.cs
- XComponentModel.cs
- WizardStepCollectionEditor.cs
- DataGridViewCheckBoxCell.cs
- WebPartRestoreVerb.cs
- UTF8Encoding.cs
- MatchingStyle.cs
- ConfigXmlElement.cs
- FieldAccessException.cs
- WebPartRestoreVerb.cs
- Rotation3D.cs
- Vector3dCollection.cs
- TextRenderingModeValidation.cs
- ResourceType.cs
- NativeMethods.cs
- PluralizationService.cs
- TimeoutException.cs
- XmlReader.cs
- SrgsToken.cs
- UpWmlMobileTextWriter.cs
- TableStyle.cs
- StrongNameMembershipCondition.cs
- TextCompositionEventArgs.cs
- TextRangeEdit.cs
- MethodAccessException.cs
- LocalizeDesigner.cs
- OperationPerformanceCounters.cs
- WebBrowserNavigatedEventHandler.cs
- NameValueSectionHandler.cs
- CompilerGeneratedAttribute.cs
- DataGridColumnCollection.cs
- VersionValidator.cs
- sqlmetadatafactory.cs
- ConsoleCancelEventArgs.cs
- DynamicQueryStringParameter.cs
- XmlValueConverter.cs
- ExpressionEditorAttribute.cs
- WebConvert.cs
- Substitution.cs
- ClaimComparer.cs
- CorrelationService.cs
- AesCryptoServiceProvider.cs
- WizardForm.cs
- FilteredDataSetHelper.cs
- WebPartEventArgs.cs
- DataStreamFromComStream.cs
- TabPanel.cs
- Utils.cs
- BulletedListEventArgs.cs
- PrintPreviewGraphics.cs
- UDPClient.cs
- StringSorter.cs
- QilXmlWriter.cs
- PkcsMisc.cs
- DeflateEmulationStream.cs
- ContentOperations.cs
- WorkflowRuntimeService.cs
- SafeReadContext.cs
- ItemsControl.cs
- _NegoState.cs
- HostingEnvironmentException.cs
- IFlowDocumentViewer.cs
- MediaSystem.cs