Note that there are some explanatory texts on larger screens.

plurals
  1. POInternal exception thrown during REST serialisation causes HTTP 401?
    primarykey
    data
    text
    <p>We have a REST service deployed in production, which returns an XML serialised representation of a simple object.</p> <p>When calling the REST 'get' method, we see a very strange problem, whereby after all our user code is finished (according to our own logs), we get a 401 in the browser which is rendering the object XML. It's failing server-side during the execution of the 'return' statement in the REST method.</p> <p>We think we understand this part of the problem... The object contains an enum, whose value is actually returned from a database. In this particular case we have managed to assign an integer value to the enum which isn't defined in the Enumeration itself (This behaviour is permitted, and is the reason for Enum.IsDefined method: <a href="http://msdn.microsoft.com/en-us/library/system.enum.isdefined.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.enum.isdefined.aspx</a>)</p> <p>Our assumption is that when the REST framework code processes the 'return' statement, it then tries to serialise the Enum to a text value, and blows up because no name (string) exists for the specified value.</p> <p>Strangely though, rather than getting a yellow screen of death or similar, we get a 401 (and a prompt for credentials in the browser).</p> <p>We were wondering if ASP.NET / IIS does some sort of Server.Transfer in these cases, but perhaps it doesn't have filesystem permissions to the page it is transferring to - ? We're baffled as to what is going on under the bonnet! There is no client-side redirect.</p> <p>Any ideas anyone?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload