Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

XML
<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>


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..
Posted
Updated 14-Sep-12 2:10am
v2

1 solution

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.
C#
[WebInvoke(
Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "/SampleUrl")]


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.
 
Share this answer
 
Comments
cutie1 15-Sep-12 1:20am    
Yes I Have defined my webinvoke attribute with Method="GET".When I use content-type:application/json its not showing any response..I don't know where Iam I going wrong?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900