[Mono-list] webHttpBinding WebInvoke POST issue

Nadeem Backus nadeem.backus at gmail.com
Sun Jun 12 18:40:47 EDT 2011

Dear All,

I have implemented a service operation which recieves a file (multipart)
via  HTTP POST (as a stream) from an asyncronous uploader (SWFupload), this
has been done using the webHttpBinding  in system.servicemodel.web. The
service is running as a console host on an unbuntu 10.10 system with mono
2.10, it fails in this environment yet works in .net 4.0 in windows. I am
getting the following exception when a post is attempted:

Unhandled Exception: System.NotSupportedException: Operation is not
(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
(TimeSpan tout, System.ServiceModel.Channels.RequestContext& ctx) [0x00000]
in <filename unknown>:0

The Operation Contract code is this:

        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "/UploadImage")]
        Stream UploadImage(Stream data);

Having looked though the library source code I see that RawMessage has been
implemented (I am unsure to what extend it has been completed) , but
OnWriteBodyContents is throwing a not supported exception. How else can I
get access to the posted stream data?

Any help will be greatly appreciated, thank you in advance :-)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20110612/d0cded1d/attachment.html 

More information about the Mono-list mailing list