[Fiddler] ReadResponse()失败:服务器未返回对此请求的响应. [英] [Fiddler] ReadResponse() failed: The server did not return a response for this request.

查看:3127
本文介绍了[Fiddler] ReadResponse()失败:服务器未返回对此请求的响应.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii
在运行URL时实现REST服务时,出现以下错误..
"[Fiddler] ReadResponse()失败:服务器未返回此请求的响应."我想以JSON格式返回响应?但是,当我检查以XML格式返回响应时,它的工作原理绝对是完美的...当我返回JSON响应时,这可能是什么原因?
这是我的XML回应:

Hii
In implementing the REST service when I run the URL then I get the following error..
"[Fiddler] ReadResponse() failed: The server did not return a response for this request."I want to return the response in JSON format ?However when I check for returning the response in XML format then its working absolutely perfect...What could be the possible cause of this when I return JSON response?
This is my XML response:

<CompanyList>
<Company>
<Action i:nil="true"/>
<CreatedDateTime>0001-01-01T00:00:00</CreatedDateTime>
<CreatedUser>00000000-0000-0000-0000-000000000000</CreatedUser>
<LastUpdatedDateTime>0001-01-01T00:00:00</LastUpdatedDateTime>
<LastUpdatedUser>00000000-0000-0000-0000-000000000000</LastUpdatedUser>
<VerificationPassword i:nil="true"/>
<Version>0</Version>
<Address i:nil="true"/>
<AddressId>00000000-0000-0000-0000-000000000000</AddressId>
<Id>b9ca2e32-ce88-4d72-99ce-9bc592511e85</Id>
<ParentCompanyId>00000000-0000-0000-0000-000000000000</ParentCompanyId>
<Phone i:nil="true"/>
<ProviderCompanyLookup i:nil="true"/>
</CompanyList>



在以上响应中,< lastupdateddatetime>是默认值,即返回null.我经过Google的调查,其中一个问题可能是DateTime问题.因此必须将其设置为更大的值.但是无法理解在哪里设置以及如何设置?

如果这不是我的问题,那可能是什么问题?

任何帮助表示赞赏....

谢谢..



In the above response <lastupdateddatetime> is default i.e returning null.I have gone through Google that one of the problem can be a DateTime issue.So have to set it to a bigger value..But couldn''t understand where to set and how to set ?

If this is not my problem then what could be the problem?

Any help is appreciated....

Thanks..

推荐答案

基于我对上一个问题的回答,我认为您正在开发WCF REST服务.您是否已如下定义WebInvoke属性的属性.如果使用的是 POST 方法,请将Method类型更改为 POST .
Based on my answer to your previous question, I take you are developing WCF REST service. Have you defined properties of WebInvoke attribute as below. Change Method type to POST if you are using POST method.
[WebInvoke(
Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "/SampleUrl")]



您可以使用Fiddler在调试WCF REST服务"主题上参考以下提示/技巧. (不是广告:))
调试WCF REST服务.

上面的提示基于XML数据,只需在Fiddler的请求标头"选项卡中使用 Content-Type:application/json .



You may refer my below Tip/Trick on the topic of "Debug WCF REST Service" using Fiddler. (Not an advertisement :))
Debug WCF REST Service.

Above Tip is based on XML data, just use Content-Type: application/json in "Request Headers" Tab of Fiddler.


这篇关于[Fiddler] ReadResponse()失败:服务器未返回对此请求的响应.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆