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 7896595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:56:05+00:00 2026-06-03T07:56:05+00:00

I have a WCF Ajax enabled web service that I call via jquery. It

  • 0

I have a WCF Ajax enabled web service that I call via jquery. It returns fine when I test it by just returning a string. As soon as I add some more functionality, the javascript error callback runs with no useful data. Just says ‘error’, readystate=0, status=0.

I can step through the service code and it returns an array of objects succesfully. The client doesn’t however.

Here’s the code.

[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class WebAPI
{
    [OperationContract]
    [WebGet(ResponseFormat=WebMessageFormat.Json)]
    public Person[] GetPeople(Guid groupId)
    {
        using (SchedulerContext context = new SchedulerContext())
        {
            return context.People.Where(p=>p.Group_ID==groupId).ToArray();
        }
    }
}

And on the client:

<script type="text/javascript">
    $(document).ready(function () {
        $.ajax(
                {
                    type: "GET",
                    dataType: "json",
                    contentType: "json",
                    data: { groupId: 'ae09a080-5d7c-4e92-9a87-591574b7c4b8' },
                    url: "WebAPI.svc/GetPeople",
                    error: function (error) {
                        alert("error");
                    },
                    success: function (msg) {
                        alert(msg.d);
                    }
                }

        );
    });
</script>

UPDATE:
Inspecting it with fiddler, the http result is 504 and in the ‘raw’ response tab has the following:

HTTP/1.1 504 Fiddler - Receive Failure
Content-Type: text/html; charset=UTF-8
Connection: close
Timestamp: 13:52:46.107

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

UPDATE – 2012/05/04: (btw, happy star wars day everyone!)
I figured out that the problem was in the JSON serialising. It gives a Circular Reference Exception on my entity model. Still working on a solution.

  • 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-06-03T07:56:07+00:00Added an answer on June 3, 2026 at 7:56 am

    Can you modify your service method definition to below:

    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class WebAPI
    {
        [OperationContract]
        [WebGet(UriTemplate="GetPeople/{groupId}",ResponseFormat=WebMessageFormat.Json)]
        public Person[] GetPeople(Guid groupId)
        {
            using (SchedulerContext context = new SchedulerContext())
            {
                return context.People.Where(p=>p.Group_ID==groupId).ToArray();
            }
        }
    }
    

    Now perform a GET request from Fiddler with the request as below:

    GET http://localhost:15006/WebAPI.svc/GetPeople/739526F1-7C58-4E3B-97D8-4870948BFE32 HTTP/1.1
    Content-Type: application/json
    User-Agent: localhost
    

    Now try to perform the same from your jquery call and see how the request looks.

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

Sidebar

Related Questions

We have a simple ASP.Net WCF Ajax enabled web service which is called via
I have created an Ajax enabled WCF web service that contains this simple method:
I have a web application that uses ajax enabled wcf service Service.scv .... I
I have a WCF service in an ASP.NET AJAX app that is returning json.
I have an ajax enabled WCF service method : [OperationContract] public string Test(string name)
I have an AJAX-enabled WCF service and everything works fine with the ajax endpoint.
I have seen blogs and people saying Returning dataset/datatable from an ajax enabled wcf
I need help with wcf service. i have a ajax-enabled wcf service: public class
I have a WCF based service that I use to expose AJAX functionality. Sometimes
I have created an AJAX-enabled WCF service to return a List<> of a custom

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.