locked
Nothing is returned by my data service RRS feed

  • Question

  • I'm in the early stages of trying out data services and I am encountering a rather nasty problem. I have created a database, entity model and a data service which looks like this:

    public class Bugsbuddy : WebDataService<BugsbuddyModel.BugsbuddyEntities>
    {
        // This method is called once during service initialization to allow
        // service-specific policies to be set
        public void InitializeService(IWebDataServiceConfiguration config)
        {
            // TODO: set rules to indicate which entity sets and service operations are
            // visible, updatable, etc.
            // (for testing purposes use "*" to indicate all entity sets/service
            // operations, but that option should NOT be used in production systems)

            config.SetResourceContainerAccessRule("*", ResourceContainerRights.All);

            // Example for entity sets (this example uses "AllRead" which allows reads but not writes)
            // config.SetResourceContainerAccessRule("MyEntityset", ResourceContainerRights.AllRead);

            // Example for service operations
            // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
        }

        // Query interceptors, change interceptors and service operations go here
    }

    Personally I think this should work, however the service returns just the following when accessed:

    <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
    <service xml:base="http://localhost:1802/Bugsbuddy.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
    <workspace>
    <atom:title>Default</atom:title>
    </workspace>
    </service>

    I am missing a couple of tables there, like Projects, Users, etc.
    Anybody else experienced this behavior and knows how to solve this?
    Friday, June 20, 2008 6:20 PM

Answers

  • Problem is resolved. As it turns out I had old CTP bits installed that didn't work correctly. I uninstalled the CTP bits and recreated the service file. It works fine now and I have the missing entities visible in my browser.
    Friday, June 20, 2008 6:50 PM

All replies

  • Problem is resolved. As it turns out I had old CTP bits installed that didn't work correctly. I uninstalled the CTP bits and recreated the service file. It works fine now and I have the missing entities visible in my browser.
    Friday, June 20, 2008 6:50 PM
  • I am running into same problem with northwind DB

    Here is my data service code

     public class WebDataService1 : WebDataService< NorthwindModel.NorthwindEntities>
        {
            // This method is called once during service initialization to allow
            // service-specific policies to be set
            public static void InitializeService(IWebDataServiceConfiguration config)
            {
               config.SetResourceContainerAccessRule("*", ResourceContainerRights.All);

            }

            // Query interceptors, change interceptors and service operations go here
        }
    Response I get is

      <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
    - <service xml:base="http://localhost:2332/WebDataService1.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
    - <workspace>
      <atom:title>Default</atom:title>
      </workspace>
      </service>

    On the other hand if i create a LINQ to SQL and point to data context from dbml

    public class WebDataService1 : WebDataService< DataClasses1DataContext>
        {
            // This method is called once during service initialization to allow
            // service-specific policies to be set
            public static void InitializeService(IWebDataServiceConfiguration config)
            {
               config.SetResourceContainerAccessRule("*", ResourceContainerRights.All);

            }

            // Query interceptors, change interceptors and service operations go here
        }

    I can see the list of entities


    Any suggestions?
    Thursday, July 31, 2008 7:13 PM
  • Hi W. Meints,

    What do you mean when you say CTP bits. What did you unistall to have it working? I´m having the same problem.


    Sunday, October 5, 2008 1:37 AM