1

HttpBatchResponseMessage responses never fully return on my machine, it only returns the headers but does not complete the request. I tryed the following OData sample, it works just fine on my colleagues machine:

http://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/OData/v3/ODataEFBatchSample/ReadMe.txt

(super simple to try, download, start, show network requests in the browser or fiddler)

I would really appreciate ideas for further investigations!

The response

from POST to http://localhost:15625/odata/$batch only returns the headers without any content

Cache-Control:no-cache
Content-Length:2114
Content-Type:multipart/mixed; boundary=batchresponse_1c6b4001-17b8-41bb-9579-970cdc358dba
DataServiceVersion:3.0
Date:Tue, 10 Mar 2015 17:03:40 GMT
Expires:-1
Pragma:no-cache
Server:Microsoft-IIS/8.0
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET
X-SourceFiles:=?UTF-8?B?QzpcVXNlcnNca2phcnRhblxEb3dubG9hZHNcT0RhdGFFRkJhdGNoU2FtcGxlXE9EYXRhRUZCYXRjaFNhbXBsZVxvZGF0YVwkYmF0Y2g=?=

Figured out ...

The returned headers already tell the length of the response (Content-Length:2114). I tryed to inject some custom classes an figured out:

  • Works on my colleagues computer
  • The problem occures when returning a ODataBatchContent, worked as I used a StringContent instead (which doesn't do the job)
  • The ODataBatchContent serialized perfectly fine when serializing to a MemoryStream

I Tryed

  • Disabling any Firewall, Antivirus software, Software, etc.
  • Updating Visual Studio etc., my configuration is nearly identical to the one of from my colleague
  • Debugging ... a lot

Request

POST to /odata/$batch

Status Code:202 Accepted

Headers:

Accept:multipart/mixed
Accept-Encoding:gzip, deflate
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Content-Length:1201
Content-Type:multipart/mixed;boundary=batch_b58d-91a6-2b46
DataServiceVersion:1.0
Host:localhost:15625
MaxDataServiceVersion:3.0
Origin:http://localhost:15625
Pragma:no-cache
Referer:http://localhost:15625/Index.html
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36

Thanks.

kjartan
  • 19
  • 2

0 Answers0