diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2010-07-14 22:24:54 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2010-07-14 22:24:54 +0400 |
commit | cee551a2f4eb5295434a2ab65739c47f99f2ec68 (patch) | |
tree | da82266f0002618a7c6f530fdbf0e91ddf9da9ca /mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher | |
parent | 64372ac47a02f00eaffdb4028673f285065aec0a (diff) |
2010-07-14 Atsushi Enomoto <atsushi@ximian.com>
* WebMessageEncoder.cs : support Raw message in ReadMessage() too.
Allow null content type.
* WebMessageFormatter.cs : do not depend on WebOperationContext.
add support for Raw format request.
* WebMessageEncodingBindingElementTest.cs : add test for null
content type for ReadMessage() (allowed),
* WebHttpBehaviorTest.cs : add test for deserializing Raw request
message too.
svn path=/trunk/mcs/; revision=160377
Diffstat (limited to 'mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher')
-rw-r--r-- | mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog index 0110de19f4d..7bb676199a9 100644 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog +++ b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/ChangeLog @@ -1,5 +1,10 @@ 2010-07-14 Atsushi Enomoto <atsushi@ximian.com> + * WebMessageFormatter.cs : do not depend on WebOperationContext. + add support for Raw format request. + +2010-07-14 Atsushi Enomoto <atsushi@ximian.com> + * WebMessageFormatter.cs : add support for Raw format. 2010-07-06 Atsushi Enomoto <atsushi@ximian.com> diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs index 7d3180da0e7..b633c9ecf25 100644 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs +++ b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs @@ -499,16 +499,26 @@ namespace System.ServiceModel.Dispatcher throw new ArgumentNullException ("parameters"); CheckMessageVersion (message.Version); - OperationContext.Current.Extensions.Add (new WebOperationContext (OperationContext.Current)); - - IncomingWebRequestContext iwc = WebOperationContext.Current.IncomingRequest; + IncomingWebRequestContext iwc = null; + if (OperationContext.Current != null) { + OperationContext.Current.Extensions.Add (new WebOperationContext (OperationContext.Current)); + iwc = WebOperationContext.Current.IncomingRequest; + } + + var wp = message.Properties [WebBodyFormatMessageProperty.Name] as WebBodyFormatMessageProperty; + if (wp != null && wp.Format == WebContentFormat.Raw) { + var rmsg = (RawMessage) message; + parameters [0] = rmsg.Stream; + return; + } Uri to = message.Headers.To; UriTemplateMatch match = UriTemplate.Match (Endpoint.Address.Uri, to); if (match == null) // not sure if it could happen throw new SystemException (String.Format ("INTERNAL ERROR: UriTemplate does not match with the request: {0} / {1}", UriTemplate, to)); - iwc.UriTemplateMatch = match; + if (iwc != null) + iwc.UriTemplateMatch = match; MessageDescription md = GetMessageDescription (MessageDirection.Input); |