This was the first time I encountered this kind of error after dealing with RESTful web service in couple of times. I find it hard to trace the cause of error, hope you could help me.
I have this attribute for Login service
[WebGet(UriTemplate = "Login?username={username}&password={password}&ip={ip}", ResponseFormat = WebMessageFormat.Json)]
Using fiddler to use the service:
GET http://localhost:3445/Authenticate/Login?username=jsm&password=a&ip=1
Fiddler response:
[Fiddler] ReadResponse() failed: The server did not return a response for this request.
I’m not sure if it caused by, Content-type: application/json because when I try to change it to xml:
[WebGet(UriTemplate = "Login?username={username}&password={password}&ip={ip}", ResponseFormat = WebMessageFormat.Xml)]
It gives me this result:
Kinda weird. What I have done wrong? I have to return json object.. Thanks!
The cause of error is the loading of bunch data types (see the preview of xml data above). Json has a limit of approximately 65K objects, and in my project it exceeds the limit. So the final solution is to create DTO – “Data Transfer Object” that will minimize the data to be passed.