Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / HttpRequestMessageProperty.cs / 2 / HttpRequestMessageProperty.cs
//----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System;
using System.Net;
using System.ServiceModel.Activation;
using System.Collections.Specialized;
public sealed class HttpRequestMessageProperty
{
WebHeaderCollection headers;
string method;
string queryString;
bool suppressEntityBody;
HttpListenerRequest listenerRequest;
HostedRequestContainer hostedRequestContainer;
internal HttpRequestMessageProperty(HttpListenerRequest listenerRequest)
: this()
{
this.listenerRequest = listenerRequest;
}
internal HttpRequestMessageProperty(HostedRequestContainer hostedRequest)
: this()
{
this.hostedRequestContainer = hostedRequest;
}
public HttpRequestMessageProperty()
{
this.method = "POST";
this.queryString = string.Empty;
this.suppressEntityBody = false;
}
public static string Name
{
get { return "httpRequest"; }
}
public WebHeaderCollection Headers
{
get
{
if (this.headers == null)
{
this.headers = new WebHeaderCollection();
if (this.listenerRequest != null)
{
this.headers.Add(this.listenerRequest.Headers);
// MB 57988 - System.Net strips off user-agent from the headers collection
if (this.listenerRequest.UserAgent != null && this.headers[HttpRequestHeader.UserAgent] == null)
{
this.headers.Add(HttpRequestHeader.UserAgent, this.listenerRequest.UserAgent);
}
this.listenerRequest = null;
}
else if (this.hostedRequestContainer != null)
{
this.hostedRequestContainer.CopyHeaders(this.headers);
this.hostedRequestContainer = null;
}
}
return this.headers;
}
}
public string Method
{
get
{
return this.method;
}
set
{
if (value == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
this.method = value;
}
}
public string QueryString
{
get
{
return this.queryString;
}
set
{
if (value == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("value");
}
this.queryString = value;
}
}
public bool SuppressEntityBody
{
get
{
return this.suppressEntityBody;
}
set
{
this.suppressEntityBody = value;
}
}
internal void MakeRequestContainerNull()
{
this.hostedRequestContainer = null;
}
}
}
// 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
- HTTPNotFoundHandler.cs
- XsltException.cs
- HijriCalendar.cs
- Matrix3DValueSerializer.cs
- EventLogEntry.cs
- TreeViewImageIndexConverter.cs
- UnSafeCharBuffer.cs
- Translator.cs
- BitmapEffectCollection.cs
- FormViewUpdatedEventArgs.cs
- ChameleonKey.cs
- SafeEventLogWriteHandle.cs
- ScriptResourceAttribute.cs
- recordstatefactory.cs
- Trace.cs
- HttpStreamXmlDictionaryReader.cs
- IconConverter.cs
- HtmlInputControl.cs
- DataRecordInfo.cs
- ValueUnavailableException.cs
- DataGridViewRowCancelEventArgs.cs
- StateMachineAction.cs
- RIPEMD160Managed.cs
- RequestBringIntoViewEventArgs.cs
- DecoratedNameAttribute.cs
- StringFunctions.cs
- CngAlgorithm.cs
- TextEffectCollection.cs
- PrintPageEvent.cs
- QueryConverter.cs
- XmlILTrace.cs
- ImmutableObjectAttribute.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- UTF8Encoding.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- ThreadInterruptedException.cs
- StringExpressionSet.cs
- RepeatButtonAutomationPeer.cs
- FontStretch.cs
- TypeReference.cs
- BamlRecordReader.cs
- SafeLocalAllocation.cs
- APCustomTypeDescriptor.cs
- WorkflowExecutor.cs
- ListView.cs
- AttachedPropertyInfo.cs
- ColorAnimationBase.cs
- ListViewInsertEventArgs.cs
- SchemaImporterExtensionsSection.cs
- EpmCustomContentSerializer.cs
- ObjectParameterCollection.cs
- SqlConnectionPoolProviderInfo.cs
- ExtendedProtectionPolicy.cs
- CredentialCache.cs
- SurrogateDataContract.cs
- HMACMD5.cs
- CommandTreeTypeHelper.cs
- FixedSOMPageConstructor.cs
- ScrollViewer.cs
- MediaContext.cs
- RepeaterItemCollection.cs
- ToolStripCollectionEditor.cs
- Identity.cs
- EventEntry.cs
- OrderedHashRepartitionEnumerator.cs
- XamlToRtfWriter.cs
- CryptoApi.cs
- AncestorChangedEventArgs.cs
- RenderingEventArgs.cs
- XmlName.cs
- OpCodes.cs
- CorrelationActionMessageFilter.cs
- ContentElement.cs
- HttpProtocolReflector.cs
- LocatorPart.cs
- DecoratedNameAttribute.cs
- KeyGestureValueSerializer.cs
- HTMLTextWriter.cs
- StringAnimationBase.cs
- Int32CollectionValueSerializer.cs
- EdmToObjectNamespaceMap.cs
- SerializationFieldInfo.cs
- UIElementHelper.cs
- CheckableControlBaseAdapter.cs
- Serializer.cs
- OperationInvokerTrace.cs
- SqlReferenceCollection.cs
- MethodAccessException.cs
- XmlSerializationWriter.cs
- HtmlTableCell.cs
- PropertyItem.cs
- NativeMethods.cs
- CategoryNameCollection.cs
- XmlCodeExporter.cs
- DrawingServices.cs
- WindowsGraphics.cs
- StrokeNodeEnumerator.cs
- ConditionalAttribute.cs
- MDIControlStrip.cs
- ParallelTimeline.cs