Solved

Simple WCF Data Service Not working

Posted on 2014-11-10
3
316 Views
Last Modified: 2015-02-16
Hello,

I created a simple WCF Data Service in an ASP.NET web forms application to use with a Telerik grid, and the service doesn't work.  It returns nothing to the grid, and when I try to browse to the service itself I get "Request Error
The server encountered an error processing the request. See server logs for more details."

My IISExpress log gives me this:  
2014-11-10 14:47:46 ::1 GET /QAD_Trans.svc/ - 53096 zzz\zzz::1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/38.0.2125.111+Safari/537.36 - 500 0 0 124

The entirety of the code for the service is this:
using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Data.Services.Common;
using System.Linq;
using System.ServiceModel.Web;
using System.Web;
using System.Linq.Dynamic;

namespace QAD_Transactions_Grid
{
    public class QAD_Trans : DataService<PTMDataMartEntities>
    {
     // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
            // Examples:
            config.SetEntitySetAccessRule("*", EntitySetRights.All);
            config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        }
        [WebGet]
        public int GetCount(string where)
        {        

            return String.IsNullOrEmpty(where) ? CurrentDataSource.QAD_Transactions.Count() :
                 CurrentDataSource.QAD_Transactions.Where(where).Count();
        }
    }
}

Open in new window


Any ideas?  

Thanks
0
Comment
Question by:Martin Bertram
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 40434287
500 is an internal server error.  Use it on a real IIS is my suggestion.
0
 

Author Comment

by:Martin Bertram
ID: 40434989
Thanks David.  I get the same thing on IIS.  

2014-11-11 14:15:54 172.16.0.2 GET /QAD_Transactions_Grid/QAD_Trans.svc/ - 80 - 172.16.2.10 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/38.0.2125.111+Safari/537.36 500 0 0 218
0
 

Author Comment

by:Martin Bertram
ID: 40612032
It was because I was using Entity Framework v6.  Apparently it has to be v5 to work.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question