The Model
public class SimpleUser
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string UserNam
What am I missing here?
You are missing to reset the stream before consuming it:
var inputStream = controllerContext.HttpContext.Request.InputStream;
inputStream.Position = 0;
return serializer.Deserialize(inputStream);
or use an XmlReader:
using (var inputStream = controllerContext.HttpContext.Request.InputStream)
using (var reader = XmlReader.Create(inputStream))
{
return serializer.Deserialize(reader);
}