I have created a OData service (sln enclosed), with Authentication, Operations and an Action with a single parameter:
[WebInvoke(Method = "POST")]
public void DeletePeople(string guidsToDelete) {...}
The problem is that the 'DeletePeople' method is called, but with empty parameters (guidsToDelete = null)
even when the parameter value is included in the HTTP POST body.
// Fiddler capture seems ok:
POST BODY:
{"guidsToDelete":"f767f533-5143-4cd1-8b8f-375594533f81"}
HEADERS:
POST /Person.svc/DeletePeople HTTP/1.1
Host: localhost:52011
Connection: keep-alive
Content-Length: 56
Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
MaxDataServiceVersion: 2.0
Origin: http://localhost:52011
DataServiceVersion: 2.0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36
Content-Type: application/json;odata=verbose
Referer: http://localhost:52011/Index.htm
Accept-Encoding: gzip,deflate,sdch
Accept-Language: es,en-US;q=0.8,en;q=0.6
I have tried both with the .Net (WCF Data Services 5.3 & 5.6) and the JS (JayData) clients, with the same results.
Anybody with the same problem?
TO REPRODUCE:
1. Install the Microsoft.Data.Services package in both the client and the service projects
2. Modify the conn string in the web.config file
Attachments
Filename |
File size |
Added on |
Approval |
ODataToSend.zip
|
292,135 |
29-Aug-2013 18:41.28 |
Approved |