wcf-data-services

datacontract attribute is required in WCF?

二次信任 提交于 2019-12-13 04:45:47
问题 is in WCF DataContract attribute is required? I have a class that class is not marked with DataContract or property with DataMember. When i deploy wcf service on 4 server, out 4 service works fine on 3 server and failed on 1 server with message "Type 'Class' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute." So is there any settings in web.config or machine.config or in

WCF Data Service with WIF 4.5; Principal not set for POST requests

放肆的年华 提交于 2019-12-13 04:29:28
问题 After following Dominick Baier's Pluralsight courses and blogs around WIF 4.5, I'm still stuck with problem that I'm unable to resolve. I am using WCF Data Services with claims based authorization using WIF 4.5. I have my ClaimsAuthenticationManager and ClaimsAuthorizationManager set up in the web.config: <section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken

WCF Data Services query projection with nullable navigation properties

感情迁移 提交于 2019-12-13 01:17:36
问题 I'm trying to write a query against a WCF data service that performs a projection that includes nullable navigation properties (i.e. the FK column in the underlying data model is nullable, so the association is 0..1). The project language is VB.NET, not by my choice. Example portion of query: From t In DataServiceReference.Context.Transactions Where t.ID = transactionID Select CSM = t.WrittenByEmployee.Name, _ t.CustomerFirstName When this query is executed against a row where

Dynamically adding WCF Data Services Endpoints

谁都会走 提交于 2019-12-13 00:25:34
问题 I've been researching oData and WCF DataServices and I think it would work great for my project. However, each of our clients have their own database. So, is there a way to dynamically create a WCF endpoint that I could point to a database. The schema for all the databases are identical. For Example: Client1 needs DB1, they would use the URL: https://webservice.com/wcf/Client1 which would use DB1 Client2 needs DB2, they would use the URL: https://webservice.com/wcf/Client2 which would use DB2

WCF Data Service - How to set Page Size programmatically?

戏子无情 提交于 2019-12-12 23:06:39
问题 I have an OData Service setup using WCF Data Services (v2) that is hosted on the server. In the client applications we are creating, we are wondering if there is any way we can programmatically set the paging size? For example, this works if I set it in the .svc: public static void InitializeService(ODataServiceConfiguration serviceConfig) { serviceConfig.SetServiceOperationAccessRule("*", ServiceOperationRights.All); serviceConfig.SetEntitySetAccessRule("*", EntitySetRights.All); // *** I

How to turn on IIS7 output cache for WCF data services (OData)

感情迁移 提交于 2019-12-12 16:20:03
问题 I have a WCF data service which is sensitive to a quite sophisticated notion of parameters in terms of URL. The common case is having the URLs like http://host:port/DataServices/NavigationMetadataService.svc/Inventories('2.1.11.5')?$expand=Components,Items,Items/Properties,Items/Properties/Values (OData notion of parameters). The service is supposed to return static data. This means that for one unique combination of parameters the response will always be the same (but its size is about 10-20

Coping with Lagging Enum Support

巧了我就是萌 提交于 2019-12-12 16:03:06
问题 The Entity Framework will not support enum's until EF 5.0 (scheduled to ship soon). Entity Framework 4.2 enum support http://blogs.msdn.com/b/efdesign/archive/2011/06/29/enumeration-support-in-entity-framework.aspx http://visualstudiomagazine.com/blogs/data-driver/2012/01/entity-framework-4-3-gets-final-tune-up.aspx WCF Data Services (and the oData standard) to not support enums We understand that enums are common, unfortunately they never met tha bar so far. They are rather high on our list

Inheritance is not supported, even with a custom OData Service Provider?

冷暖自知 提交于 2019-12-12 13:29:31
问题 EDIT : I went ahead and created a little project to demonstrate this issue (called RestfulTimesTest), available on SkyDrive. I built a custom OData Service Provider to provide queries and updates into a custom model, based on Alex James' excellent blog post on Creating a Data Service Provider. Consider the following 3 CLR classes: ResidentialCustomer , Customer , and User . ResidentialCustomer extends Customer , Customer has a list of User s, and User has a reference back to Customer . The

Combine ADO.NET Data Service and custom ServiceContract in the same class?

梦想的初衷 提交于 2019-12-12 12:22:18
问题 I have an ADO.NET Data service that I run through WCF: public class AdminService : DataService<BOPApplicationAccessEntities> { public static void InitializeService(DataServiceConfiguration config) { config.UseVerboseErrors = true; config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; config.SetEntitySetAccessRule("*", EntitySetRights.All); } } I'd like to add some custom methods to it, such as the following contract [ServiceContract] public interface IAdminService {

Supported Linq for WCF Data Services

ぐ巨炮叔叔 提交于 2019-12-12 10:56:33
问题 I'm looking for the full list of supported linq extension methods that are compatible with WCF Data Services. By trial and error I've found First( Func ) and Single( Func ) aren't supported, any others? This gives me a pretty good idea of whats supported, I just don't know whats actually translated via the IQueryProvider. 回答1: I've found a site listing the unsupported linq methods http://msdn.microsoft.com/en-us/library/ee622463.aspx#unsupportedMethods 回答2: First and Single are not supported