This question is locked. New answers and comments are not allowed.
I have began a model and created a WCF Data Service to handle some custom data that needs to be returned from the service. I attempted adding a custom WebGet Service Operation and continually get a 404 File Not found when navigating.
My Svc file is as follows:
Not sure what I am doing wrong as declaring [WebGet] attribute and ServiceOperationAccessRule should be all that is required in order to call the method even from the browser.
Also if I set config.SetServiceOperationAccessRule("Hello", ServiceOperationRights.All) instead of using a wildcard(*) the service throws an exception.
Any help would be appreciated...
My Svc file is as follows:
[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults =
true
)]
public
partial
class
MyEntitiesModelService : OpenAccessDataService<MyEntities.MyEntitiesModel>
{
public
static
void
InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule(
"Vendors"
, EntitySetRights.All);
config.SetEntitySetAccessRule(
"UserSettings"
, EntitySetRights.All);
config.SetServiceOperationAccessRule(
"*"
, ServiceOperationRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
[WebGet]
public
string
Hello(
string
name)
{
return
"Hello "
+ name;
}
}
Not sure what I am doing wrong as declaring [WebGet] attribute and ServiceOperationAccessRule should be all that is required in order to call the method even from the browser.
Also if I set config.SetServiceOperationAccessRule("Hello", ServiceOperationRights.All) instead of using a wildcard(*) the service throws an exception.
Any help would be appreciated...