Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

enter image description here

Fiddler response:

[Fiddler] ReadResponse() failed: The server did not return a response for this request.  

enter image description here

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:

enter image description here

Kinda weird. What I have done wrong? I have to return json object.. Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
981 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...