Bug 156 - Failed to handle POST request in WCF/REST server app
Summary: Failed to handle POST request in WCF/REST server app
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Configuration ()
Version: 2.10.x
Hardware: PC Linux
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-08-02 22:50 UTC by Roman Sakno
Modified: 2011-08-25 02:09 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Roman Sakno 2011-08-02 22:50:07 UTC
I have a simple WCF service with a method that handles the HTTP POST request:
[OperationContract(Name = "Request")]
[WebInvoke(UriTemplate = "/request", ResponseFormat = WebMessageFormat.Json, Method = WebRequestMethods.Http.Post)]
public bool Request(Stream requestBody)
  return false;
WCF host crushes with the following stack trace when client send HTTP POST request to the service:
Unhandled Exception: System.NotSupportedException: Operation is not supported.
  at System.ServiceModel.Dispatcher.WebMessageFormatter+RawMessage.OnWriteBodyContents (System.Xml.XmlDictionaryWriter writer) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.Message.WriteBodyContents (System.Xml.XmlDictionaryWriter writer) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.Message.OnCreateBufferedCopy (Int32 maxBufferSize) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.Message.CreateBufferedCopy (Int32 maxBufferSize) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Logger.LogMessage (MessageLogSourceKind sourceKind, System.ServiceModel.Channels.Message& msg, Int32 maxMessageSize) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.Http.HttpReplyChannel.TryReceiveRequest (TimeSpan timeout, System.ServiceModel.Channels.RequestContext& context) [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Channels.ReplyChannelBase.<BeginTryReceiveRequest>m__20 (TimeSpan tout, System.ServiceModel.Channels.RequestContext& ctx) [0x00000] in <filename unknown>:0 

This exception is actual for 2.10.2 version. In 2.10.1 the bug doesn't exist.
Comment 1 Roman Sakno 2011-08-25 02:09:35 UTC
Fixed in 2.10.4.