Solved

Simple WCF Data Service Not working

Posted on 2014-11-10
3
330 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 82

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

624 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