HttpServer and HttpRequest.Body question

Topics: faq
Dec 3, 2009 at 8:52 AM
Edited Dec 3, 2009 at 8:53 AM

Hi,

First of all, thanks to all the developers for the really good work you are doing here.

I having some troubles with the module mostly because i don't understand it's behaviour. I'm developing a little webservice for device integration in a webapplication and I'm using HttpServer to getting xml queries (soap rpc).

Using HttpListener there is no problem with this, but when I try to use HttpServer with modules the things get a little troublesome. Request BODY field is not readable (are closed or disposed) at every attempt. I've done a little dubug to trace the "problem" so I found it is caused by DecodeBody(request) called by HttpServer in HandleRequest function. In particular XmlDecoder is used to parse XML payload and uses

using (TextReader reader = new StreamReader(stream, encoding))

that get the control of the MemoryStream and uses it. However I have no need to do any processing on the message body nor I can set HttpServer.FormDecoderProviders to null.

Is this working as intended? Am I using it in the wrong way? Or it's a bug?

Damiano.

Coordinator
Dec 15, 2009 at 6:42 AM

FormDecoderProvider can now be empty.