diff options
author | Miguel de Icaza <miguel@gnome.org> | 2011-10-16 19:41:36 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2011-10-16 19:46:00 +0400 |
commit | 8c810e02a34055b7d448810d42ca30d78fdfc00b (patch) | |
tree | 2bcc8c311aba9a48a945301be92904ae325669f4 /mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs | |
parent | abbb1550d39077a7ceb40d7aeb01273b17e01c02 (diff) |
Apply patch from Mario Kosmiskaso fix bug 1209: Patch to correctly expose WebOperationContext.IncomingResponse
There was apparently no point in the call flow when the reponse message was set
in the context, resulting in WebOperationContext.IncomingResponse always being
null.
After patching WebMessageFormatter to set the response in the context (if
available) the value of WebOperationContext.IncomingResponse was still null. A
bit more investigation showed that IncomingWebResponseContext would construct a
HttpResponseMessageProperty encapsulating the OperationContext at the time the
request was made but before the response was received and cache that object.
That caused the HttpResponseMessageProperty to always have a null value for the
response. The second part of the patch changes this behavior and always creates
a new HttpResponseMessageProperty on GET.
Diffstat (limited to 'mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs')
-rw-r--r-- | mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs | 5 |
1 files changed, 5 insertions, 0 deletions
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 34d4040392b..1cb5eef442b 100644 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs +++ b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs @@ -386,6 +386,11 @@ namespace System.ServiceModel.Dispatcher throw new ArgumentNullException ("parameters"); CheckMessageVersion (message.Version); + if (OperationContext.Current != null) { + // Set response in the context + OperationContext.Current.IncomingMessage = message; + } + if (message.IsEmpty) return null; // empty message, could be returned by HttpReplyChannel. |