I am <sick to death> of IIS unpredictable behaviour, each version is causing more and more unrelated and random messages. <sigh>
You first should make sure that your codec throwing does result in a 401 (probably something we should do in the fx ourselves, if all operations fail and all fail because the codec throws).
Second, what html page is that? Is this the one in OpenRasta or the one from IIS? I assume it's the latter, as the use of "verb" to mean "method" is something typical of MS software. If that is the case, it would seem that the "friendly erorrs" of iis or aspx is kicking in, overriding whatever we send down.
So I'd deactivate that IIS "feature".
> -----Original Message-----
> From: open...@googlegroups.com [mailto:open...@googlegroups.com]
> On Behalf Of Rob
> Sent: 11 May 2011 02:24
> To: OpenRasta
> Subject: [openrasta] Re: On Dev PC getting back error json resource
> correctly, on IIS7.5 getting back html error page.
>
> I captured a bit more information - by creating an ILogger and feeding it
> through Elmah, for want of a better trace watcher.
> Thought it might help so am posting, it does not look like something is
> particularly wrong to me.
> The calls are newest at top here.
>
> Type Error
> Debug Writing http headers. Details.
> Debug Setting Content-Length to 147 Details.
> Debug Codec NewtonsoftJsonCodec selected. Details.
> Info Selected codec NewtonsoftJsonCodec out of 1 codecs for entity of
> type ResourceListWrapper`1 and negotiated media type application/json;
> q=0.5. Details.
> Info Executing CollectResourceErrors Modified OperationResult:
> type=MethodNotAllowed, statusCode=405. Details.
> Exception Got the error "An expected field containing Date
> information could not be read as a date.". Details.
> Exception Got type MetricsAndErrors "moo". Details.
> Exception Got currentResource
> "TrakkaShell.Resources.ResourceListWrapper`1[TrakkaShell.Resources.Asset
> MeterReadingImport]".
> Details.
> Exception Got context.OperationResult "OperationResult:
> type=MethodNotAllowed, statusCode=405". Details.
> Exception Got server error "Exception: System.FormatException: The
> string was not recognized as a valid DateTime. There is an unknown word
> starting at index 0. at System.DateTime.Parse(String s, IFormatProvider
> provider, DateTimeStyles styles) at
> Newtonsoft.Json.Converters.IsoDateTimeConverter.ReadJson(JsonReader
> reader, Type objectType, Object existingValue, JsonSerializer
> serializer) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json
> \Converters\IsoDateTimeConverter.cs:line 131 at N Details.
> Info Executing CollectResourceErrors before OperationResult:
> type=MethodNotAllowed, statusCode=405. Details.
> Info Executing OperationResult OperationResult:
> type=MethodNotAllowed, statusCode=405. Details.
> Format The string was not recognized as a valid DateTime. There is an
> unknown word starting at index 0. Details.
> Info Operation Handler`1::Post(AssetMeterReadingImport newresource)
> selected with 1 required members and 0 optional members, with codec
> NewtonsoftJsonCodec with score 0. Details.
> Info Operation Handler`1::Post(AssetMeterReadingImport newresource)
> selected with 1 required members and 0 optional members, with codec
> NewtonsoftJsonCodec with score 0. Details.
> Info Operation Handler`1::Post(Int32 siteID, IEnumerable`1 resources)
> selected with 2 required members and 0 optional members, with codec
> NewtonsoftJsonCodec with score 1. Details.
> Info Operation Handler`1::Post(Int32 siteID, IEnumerable`1 resources)
> selected with 2 required members and 0 optional members, with codec
> NewtonsoftJsonCodec with score 1. Details.
> Debug Found 0 operation(s) with matching [HttpOperation] attribute.
> Details.
> Debug Found 3 operation(s) with a matching name. Details.
Secondly, having a fallback handler is something that may be useful indeed and has been requested in the past, so maybe we'll implement that, it'd be a good idea. As usual, if theres a bug on github I can track it and make sure we spend some time on it (http://github.com/openrasta/openrasta-core/)
Seb
When you host things on top of asp.net, OpenRasta gives the content back to asp.net, which in turn gives it back to IIS. Both have their own modules that have the capacity to do evil things, such as overriding responses. This is probably what happens here and is a config issue.
I'm happy helping you debug what component of IIS is doing that, I'd need to know what modules you have installed and how they are configured for your site. Maybe sending the .config for the application would help.
Can this not be delegated to the web.config I wonder, or is that a per application setting?
I’m thinking that we should provide a pre-packaged hosting environment for openrasta, as a web platform installer package, so you can just add that to your IIS and then just deploy whatever openrasta stuff you want. Would people find that useful?