wcf-data-services

Odata Query with DataServiceContext and get result as json

↘锁芯ラ 提交于 2019-12-24 02:30:16
问题 I have a DataServiceContext querying my WCF Data Service: service = new DataServiceContext(new Uri(SvcUrl)); service.SendingRequest += new EventHandler<SendingRequestEventArgs> (OnSendingRequest); I want to set the Accept header so that I get the result as json: static void OnSendingRequest(object sender, SendingRequestEventArgs e) { e.RequestHeaders.Set("Accept", "json/text"); } But I get an exception: "This header must be modified using the appropriate property or method. Parameter name:

Create WCF Data Service for use in service host

五迷三道 提交于 2019-12-23 13:15:39
问题 I have a service application that host several WCF endpoints through different bindings. I want now to host a WCF Data Service in the same service Host. This post makes me believe it's possible. However, every single example on how to create a WCF Data Service creates it from inside an ASP.NET Web project, not a Class Library or Service Application. In fact, the WCF Data Service doesn't even show up in the Add New Item when selected from one of these project types. My question is how do I

How to consume WCF Data Service Operations in client .NET Application?

半世苍凉 提交于 2019-12-23 12:29:00
问题 Alright folks, I am a newcomer to Data Services and LINQ in desperate need of some guidance. In just a few days I have encountered numerous unexpected obstacles and I'm stuck on one now. I'm hoping these are just typical frustrations of learning a new tool. I have a WCF Data Service for serving up data from a Sql Server database table of Gps coordinates. In particular I have a service operation method that allows you to specify a decimal precision and latitude/longitude range to produce a

How can I join data with Linq to Entities and WCF Data Services?

人走茶凉 提交于 2019-12-23 03:24:31
问题 I have 4 entities that are related as follows: LocalAgency<-0..1----1->Agency<-0..1----1->Organization<-0..1----1->Customer In other words, a LocalAgency has one related Agency , etc. The data model is set up using Entity Framework (containing navigation properties to peruse those relationships), and a WCF DataService is set up to provide that data to clients. On the client side that consumes the DataService , I'm trying to return a query of local agencies based on a customer name, but haven

Empty svc file using WCF Ria Services and ADO .NET Data Services

早过忘川 提交于 2019-12-23 03:04:01
问题 I have a WCF RIA project getting my data from an SQL Server 2008 via Entity framework. Everything is going well. However I would like to access data via a windows mobile so, as far as I can understand I have to create an ADO.NET Data Service. My domain service is called BusinessLogicDomainService.cs. Immediately after creating the corresponding BusinessObjectsDataService I write this: public class BusinessObjectsDataService : DataService<BusinessObjectsDomainService> { public static void

WCF Data Services 5.0 Workaround for returning POCOs?

℡╲_俬逩灬. 提交于 2019-12-22 20:43:32
问题 I'm pretty sure it hasn't, but apologies if this question has already been asked. And additional apologies if this is just flat out a dumb question but I feel like I'm either completely missing something or have the right idea and just need some backup for my own sanity. I've been implementing WCF Data Services 5.0 in our application and am having no issues with read operations returning entity objects. Unfortunately there is that nasty limitation when it comes to service operations that they

WCF Data Services 5.0 Workaround for returning POCOs?

倾然丶 夕夏残阳落幕 提交于 2019-12-22 20:43:02
问题 I'm pretty sure it hasn't, but apologies if this question has already been asked. And additional apologies if this is just flat out a dumb question but I feel like I'm either completely missing something or have the right idea and just need some backup for my own sanity. I've been implementing WCF Data Services 5.0 in our application and am having no issues with read operations returning entity objects. Unfortunately there is that nasty limitation when it comes to service operations that they

How can you expose a multi-layer model that has derived classes and members for OData services?

南笙酒味 提交于 2019-12-22 18:16:55
问题 I'm trying to expose a model to be available for OData services. The approach I'm currently taking is along the lines of: 1) Defining a class in the model to expose IQueryable collections such as: public class MyEntities { public IQueryable<Customer> Customers { get { return DataManager.GetCustomers().AsQueryable<Customer>(); } } public IQueryable<User> Users { get { return DataManager.GetUsers().AsQueryable<User>(); } } } 2) Set up a WCF DataService with the queryable collection class such

How to pass authentication header to OData Service

筅森魡賤 提交于 2019-12-22 11:35:42
问题 I am following authentication method described at http://blogs.msdn.com/b/astoriateam/archive/2010/07/21/odata-and-authentication-part-6-custom-basic-authentication.aspx I am able to consume service using ASP.NET (not a problem at all). Now I would like to create a plain HTML page and access the service using "OData Javascript Library" (datajs). If I disable authentication and request for data, it works fine. I could not find any sample code on how to send authentication header information

How to pass authentication header to OData Service

流过昼夜 提交于 2019-12-22 11:35:04
问题 I am following authentication method described at http://blogs.msdn.com/b/astoriateam/archive/2010/07/21/odata-and-authentication-part-6-custom-basic-authentication.aspx I am able to consume service using ASP.NET (not a problem at all). Now I would like to create a plain HTML page and access the service using "OData Javascript Library" (datajs). If I disable authentication and request for data, it works fine. I could not find any sample code on how to send authentication header information