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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:45:29+00:00 2026-05-14T00:45:29+00:00

I have a simple WCF Data Services service and I want to expose a

  • 0

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 ProductDataService : 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?

I’m running Visual Studio 2008 SP1 and .NET Framework 3.5 SP1. I also downloaded and installed this update:

MS KB: 976127 – An update is available that provides additional features and improvements for ADO.NET Data Services in the .NET Framework 3.5 SP1 on a computer that is running Windows 7 or Windows Server 2008 R2

  • 1 1 Answer
  • 1 View
  • 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-05-14T00:45:30+00:00Added an answer on May 14, 2026 at 12:45 am

    Finally solved this. To call a service operation on a data service class you need to use data service context object’s CreateQuery or Execute methods. For example:

    ProductDataService ctx = new ProductDataService(
        new Uri("http://localhost:1234/ProductDataService.svc/"));
    
    // Method 1:
    DataServiceQuery<Product> q = ctx.CreateQuery<Product>("GetProducts");
    List<Product> products = q.Execute().ToList();
    
    // Method 2:
    Uri uri = new Uri(String.Format("{0}GetProducts", ctx.BaseUri), 
                 UriKind.RelativeOrAbsolute);
    List<Product> products = ctx.Execute<Product>(uri).ToList();
    

    If parameters were required, say a product category on a service operation that had this signature:

    [WebGet]
    public IQueryable<Product> GetProducts(string category)
    

    We would do:

    // Method 1:
    DataServiceQuery<Product> q = ctx.CreateQuery<Product>("GetProducts")
                                    .AddQueryOption("category", "Boats") ;
    List<Product> products = q.Execute().ToList();
    
    // Method 2:
    Uri uri = new Uri(String.Format("{0}GetProducts?category={1}", 
                        ctx.BaseUri, "Boats"), UriKind.RelativeOrAbsolute);
    List<Product> products = ctx.Execute<Product>(uri).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple WCF service: public Order[] GetOrdersByStatus(int statusid) { OrderService os =
I have a simple WCF Web service. It's hosted on IIS under the default
We have a simple WCF service that is tagged with InstanceContextMode = Single and
I have created a simple wcf service which used the WCF Service Library template.
I have written a simple WCF service that accepts and stores messages. It works
I have a very simple wcf server. When a client uses an operation contract,
I have written a very simple WCF service, that worked fine (code below), then
i have a simple xml file in a wcf service that i am trying
I have been having some issues retrieving JSON data from a WCF service application
I have a simple Silverlight application that use WCF RIA Services to communicate with

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.