Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3434712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:43:55+00:00 2026-05-18T07:43:55+00:00

I recently set up a WCF Resful Service with Entity Framework 4.0 It works

  • 0

I recently set up a WCF Resful Service with Entity Framework 4.0
It works with XML perfectly, however when I try to return it in json format I got

HTTP/1.1 504 Fiddler - Receive Failure
Content-Type: text/html
Connection: close
Timestamp: 01:11:06.453

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

Any Ideas??

thanks in advance

Edit:
The Code is quite normal, actually i tried two way of doing it, but no luck.

Hard code ResponseFormat Way:

[OperationContract]
        [WebInvoke(Method = "GET",
            BodyStyle = WebMessageBodyStyle.Wrapped,
            ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "Deal/{id}")]
        Deals XMLDealDetail(string id);

Dynamically Set ResponseFormat Way:

    [OperationContract]
            [WebInvoke(Method = "GET",
                BodyStyle = WebMessageBodyStyle.Wrapped,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "Deal/{id}/{format}")]
            Deals XMLDealDetail(string id, string format);

    public Deals XMLDealDetail(string id, string format)
            {
                OutgoingWebResponseContext context = WebOperationContext.Current.OutgoingResponse;

                if (format.ToLower() == "json")
                {
                    context.Format = WebMessageFormat.Json;
                    context.ContentType = "application/json";
                }
                else
                {
                    context.Format = WebMessageFormat.Xml;
                }
//Deals is a Entity Class defined in edmx file
                    Deals deal = DealsServices.GetById(id);
                    return deal;

            }

where am i missing??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:43:56+00:00Added an answer on May 18, 2026 at 7:43 am

    By using Service Trace Viewer, actually there a number of ways of getting the problem.
    This link helped me.
    I finally see the problem, however being stacked gain with the problem.

    ‘The type ‘xxx.DataEntity.AppView’ cannot be serialized to JSON because its IsReference setting is ‘True’. The JSON format does not support references because there is no standardized format for representing references. To enable serialization, disable the IsReference setting on the type or an appropriate parent class of the type.’

    I will start a new question for that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background WCF Stack, Data Access Implemented in Entity Framework, Simple ASP.NET Front End This
We recently bought a new rack and set of servers for it, we want
I recently bought and read a box set of books on security ( Building
Let me set the stage here. I'm a very junior developer who's recently made
I've recently inherited a fairly large web site. The project is set up as
Recently, I've been dealing with an error with accessing MAPI via the .NET framework
I need help, I'm new to the WCF world having recently made the transition
I recently asked this question: Expose XML or Objects - thanks all for the
I recently set up, for a learning exercise, an Ubuntu desktop PC with KDE
Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.