This is a migrated thread and some comments may be shown as answers.

config.SetServiceOperationAccessRule issue

4 Answers 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 02 Apr 2012, 09:57 PM
Hi,
     No matter what I try and what example I use I can not seem to get the config.SetServiceOperationAccessRule to work.
I have even tried all of your examples that use Data service and on everyone it errors with The given name 'GetCars' was not found in the service operations. Parameter name: name. This works with MS DataService instead of OpenAccessDataService.
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 SofiaCarRentalDAL;
using Telerik.OpenAccess.DataServices;
 
namespace SofiaCarRentalDataService
{
    [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class SofiaCarRentalService : OpenAccessDataService<SofiaCarRentalEntityDiagrams>
    {
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.UseVerboseErrors = true;
            config.SetEntitySetAccessRule("*", EntitySetRights.All);
           config.SetServiceOperationAccessRule("GetCars", ServiceOperationRights.All);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
 
        protected override void HandleException(HandleExceptionArgs args)
        {
            base.HandleException(args);
        }
 
        [WebGet]
        public IQueryable<Car> GetCars() {
 
            return this.CurrentDataSource.Cars;
         
        }
        [ChangeInterceptor("RentalOrders")]
        public void InterceptOrders(RentalOrder order, UpdateOperations operations)
        {           
            if (operations == UpdateOperations.Add)
            {
                order.CustomerID = base.CurrentDataSource.Customers.First().CustomerID;
                order.EmployeeID = base.CurrentDataSource.Employees.First().EmployeeID;
            }
        }
    }
}

Should this work in the way I have extend the code above. Please provide an example of this working if possible.
Thanks

4 Answers, 1 is accepted

Sort by
0
Viktor Zhivkov
Telerik team
answered on 05 Apr 2012, 05:10 PM
Hello Paul,

Thank you very much for reporting a new bug in our custom data service provider. We have added it in our internal issue tracking system and we will implement a fix in near future.
While we fix the issue you have two possible work around options available:
  1. Create a new separate service that contains all the service operations that you want and keep the OpenAccess Data Service as it is generated by our wizard.
  2. Implement a custom data service provider that can handle the scenario. Here is a MSDN documentation start point about custom data service providers and here is a detailed article how to implement one step by step.

If your intention is to solely get a list of Cars OpenAccess Data Service already provides such method so you don't have to extend the service at all.

I am sorry for the inconvenience that we have caused you and I have added 500 Telerik Points to your account as a "new bug bounty". 

All the best,
Viktor Zhivkov
the Telerik team
Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
0
Viktor Zhivkov
Telerik team
answered on 14 Jun 2012, 04:59 PM
Hello Paul,

I am happy to announce that we have fixed our implementation of DataServices and now we support custom service operations out of the box in the OpenAccess Q2 2012 release. 
You can check What's new in Q2 2012 page or the release notes for more information about all changes and new features.

All the best,
Viktor Zhivkov
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
0
Ben
Top achievements
Rank 1
answered on 03 Sep 2012, 02:20 PM
I have this problem as well. So I went to the website, downloaded the Q2 2012 SP2 release. Installed it.
But the problem remains. Actually when I looked in my C:\Program Files(x86)\Telerik\OpenAccess ORM, none of the existing directories or files have been changed, I still see the old version. The only thing I see is a new directory 'ProductSDK'.
So what exactly do I need to install to have this problem solved?

Thanks

  Ben
0
Ben
Top achievements
Rank 1
answered on 03 Sep 2012, 02:42 PM
Running Telerik_OpenAccess_ORM_2012_2_607_dev.msi installed it.
Problem solved.


Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Viktor Zhivkov
Telerik team
Ben
Top achievements
Rank 1
Share this question
or