Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: JSON REST
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>
 
In the above response 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 14-Sep-12 2:09am
cutie1297
Edited 14-Sep-12 2:10am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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")]
 
You may refer my below Tip/Trick on the topic of "Debug WCF REST Service" using Fiddler. (Not an advertisement Smile | :) )
Debug WCF REST Service.
 
Above Tip is based on XML data, just use Content-Type: application/json in "Request Headers" Tab of Fiddler.
  Permalink  
Comments
cutie1 at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.141002.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100