Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

Simple WCF Data Service Not working

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
Martin Bertram
Asked:
Martin Bertram
  • 2
1 Solution
 
David Johnson, CD, MVPOwnerCommented:
500 is an internal server error.  Use it on a real IIS is my suggestion.
0
 
Martin BertramAuthor Commented:
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
 
Martin BertramAuthor Commented:
It was because I was using Entity Framework v6.  Apparently it has to be v5 to work.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now