NotImplementedException from HistoryStream when using HttpListenerHost

11 views
Skip to first unread message

James Deery

unread,
Jan 9, 2012, 1:55:47 PM1/9/12
to OpenRasta
I'm trying to write some integration tests for my project using the
HttpListenerHost. Requests using GET are working fine, but I'm getting
a NotImplementedException when I POST data:

at OpenRasta.IO.HistoryStream.get_Length() in OpenRasta\IO
\HistoryStream.cs:line 61
at OpenRasta.IO.WrapperStream.get_Length() in OpenRasta\IO
\WrapperStream.cs:line 40
at OpenRasta.IO.LengthTrackingStream.get_Length() in OpenRasta\IO
\LengthTrackingStream.cs:line 33
at System.Xml.XmlReader.CalcBufferSize(Stream input)
at System.Xml.XmlTextReaderImpl.InitStreamInput(Uri baseUri, String
baseUriStr, Stream stream, Byte[] bytes, Int32 byteCount, Encoding
encoding)
at System.Xml.XmlTextReaderImpl.InitStreamInput(Stream stream,
Encoding encoding)
at System.Xml.XmlTextReaderImpl..ctor(String url, Stream input,
XmlNameTable nt)
at System.Xml.XmlTextReaderImpl..ctor(Stream input)
at System.Xml.XmlTextReader..ctor(Stream input)
at System.Xml.Serialization.XmlSerializer.Deserialize(Stream
stream)
at OpenRasta.Codecs.XmlSerializerCodec.ReadFrom(IHttpEntity
request, IType destinationType, String parameterName) in OpenRasta
\Codecs\application\xml\XmlSerializerCodec.cs:line 26
at
OpenRasta.OperationModel.Hydrators.RequestEntityReaderHydrator.TryReadPayloadAsObject(IHttpEntity
requestEntity, IMediaTypeReader reader, IOperation operation) in
OpenRasta\OperationModel\Hydrators\RequestEntityReaderHydrator.cs:line
101

This all works fine when the code is hosted on IIS.

What can I do to make sure that the codec can read from the POST
request stream without getting an exception?

James Deery

unread,
Jan 10, 2012, 6:22:53 AM1/10/12
to OpenRasta
Oh, it looks like I'm running into this issue:

https://github.com/openrasta/openrasta-core/issues/14

Is there a work-around for this at the moment?

Sebastien Lambla

unread,
Jan 10, 2012, 8:25:48 AM1/10/12
to open...@googlegroups.com
temporarily you can have your own xml seiralizer codec that either copies the stream into a memorystream before reading it, or pass a wrapper stream to the serializer that is not seekable.

Those changes from august have not been pulled back in as I stopped working for the client I was building those changes for rather quickly...

Seb
________________________________________
From: open...@googlegroups.com [open...@googlegroups.com] on behalf of James Deery [james...@jadex.org]
Sent: 10 January 2012 11:22
To: OpenRasta
Subject: [openrasta] Re: NotImplementedException from HistoryStream when using HttpListenerHost

Reply all
Reply to author
Forward
0 new messages