This project is read-only.

Delta<T> Patch xml formatter expects random characters

Topics: ASP.NET Web API
Sep 3, 2013 at 3:32 PM
I am trying to add patch support to my api but am not able to post XML to the Patch method. If I use the example of an object Job I can do a Put and this works as expected.

My method signature looks like this
[HttpPatch, ActionName("")] public HttpResponseMessage PatchJob(string id, Delta<Job> value)
Post XML like this
<Job xmlns:i="" xmlns=""> <Description>New Description</Description> <Id>JOB1</Id> </Job>
If I then try to do a Patch using a Put
<Job xmlns:i="" xmlns=""> <Description>Updated Description</Description> </Job>
To update the description I get the response
<Error><Message>The request is invalid.</Message><ModelState><value>Error in line 1 position 92. Expecting element 'DeltaOfJobpwN2u9vl' from namespace ''.. Encountered 'Element' with name 'Job', namespace ''. </value></ModelState></Error>
I can do a patch via JSON with no problem. I can make the xml post if I use the element names from the error response, but they seem random based on the class type. I get this