Why is my ServiceOperation method missing from my WCF Data Services client proxy code?

Posted by Kev on Stack Overflow See other posts from Stack Overflow or by Kev
Published on 2010-03-18T05:00:34Z Indexed on 2010/03/18 5:01 UTC
Read the original article Hit count: 419

I have a simple WCF Data Services service and I want to expose a Service Operation as follows:

[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class ConfigurationData : DataService<ProductRepository>
{
    // This method is called only once to initialize service-wide policies.
    public static void InitializeService(IDataServiceConfiguration config)
    {
      config.SetEntitySetAccessRule("*", 
            EntitySetRights.ReadMultiple | EntitySetRights.ReadSingle);
      config.SetServiceOperationAccessRule("*", 
            ServiceOperationRights.All);
      config.UseVerboseErrors = true;
    }

// This operation isn't getting generated client side
[WebGet]
public IQueryable<Product> GetProducts()
{
    // Simple example for testing
    return (new ProductRepository()).Product;
}

Why isn't the GetProducts method visible when I add the service reference on the client?

© Stack Overflow or respective owner

Related posts about wcf-data-services

Related posts about ado.net-data-services