wcf-data-services

Empty HttpContext.Current.Request.Files in WCF Service

可紊 提交于 2019-12-07 08:38:26
I'm trying to upload files form a html5 page to a WCF Service but the Files object in the HttpContext.Current.Request is empty. Any Idea? my WCF Service: [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class FileUploader { // test file uploader [OperationContract] [WebGet] public string UploadFile() { string fileName = "no file selected"; HttpContext context = HttpContext.Current; if (context != null) { if (context.Request.Files.Count > 0) { fileName = context.Request.Files[0].FileName; } } return

Entity framework 6 data context from wcf data service

拈花ヽ惹草 提交于 2019-12-07 08:32:46
问题 I used to access the data context of my (ef 5.0) entities from inside a wcf data services service operation with this.CurrentDataSource.MyEntity . My data service inherited from DataService<T> . Now I wanted to use entity framework 6.0 and read on the internet, I should inherit the service from EntityFrameworkDataService<T> . But now from inside my service operations, I cannot access my data context anymore. this.CurrentDataSource doesn't contain any reference to the entities. 回答1: Here's my

WCF Timeout exception on service call

一曲冷凌霜 提交于 2019-12-07 07:41:41
问题 I have a WCF service that is giving the following error on live Event code: 3005 Event message: An unhandled exception has occurred. Event time: 19/06/2012 10:39:09 Event time (UTC): 19/06/2012 09:39:09 Event ID: 501c1b630958413db7c7f746b0a467f7 Event sequence: 74336 Event occurrence: 742 Event detail code: 0 Application information: Application domain: /LM/W3SVC/5/ROOT-1-129844753959691296 Trust level: Full Application Virtual Path: / Application Path: <private> Machine name: <private>

Can I Perform a 'Distinct' with a WCF Data Service (OData) Query?

微笑、不失礼 提交于 2019-12-07 06:33:26
问题 I really need to be able to perform a 'DISTINCT' on a WCF Data Service query. From what I can tell, such a function doesn't exist. I know that I can use the Distinct extension method in the Linq query on the client, but it still hydrates the full result set (which isn't what I want in this particular case). Any ideas? 回答1: Not built in. It's also not currently part of the OData protocol at all (no aggregation is other than count, which we would definitely need to even consider it). The

WCF DataService not supporting preflight OPTIONS requests?

隐身守侯 提交于 2019-12-07 03:35:59
问题 I want to use an ajax-based component (KendoUI) to read/modify entities on an OData endpoint implemented by WCF DataServices. The service implementation was fairly easy in the first place: public class MyFooService : DataService<FooContext> { public static void SetEntitySetAccessRules(IDataServiceConfiguration config) { config.SetEntitySetAccessRule("Foos", EntitySetRights.AllWrite); } } Now I was expecting to be able to modify entities using PUT. KendoUI provides a nice and easy

Can't get the JSONP working with WCF Data Services

陌路散爱 提交于 2019-12-06 22:25:47
问题 It seems from all that I read and watched, exposing JSON from a WCF Data Service should be as easy as adding the JSONPSupportBehavior attribute to the service class. The problem is that VS2010 doesn't recognize the JSONPSupportBehavior attribute. Is there a reference I am missing? It seems like from all the articles, it was supported out of the box. 回答1: WCF Data Services supports JSON out of the box, no need to add attributes or anything. In order to receive a response in JSON format clients

Tool to visualise OData WebAPI / WCF Data Service?

二次信任 提交于 2019-12-06 16:42:30
This question is about situation when you get access to the DataService and want to quickly explore what kind of functionality (EDM?) is available. Do we have any such tool that could help us to learn services? Something like building class diagram from the code during re-engineering... LINQPad implements an "OData / WCF Data Services" connector. So, you can explore metadata and query data quikly. I had the same issue that I wanted our customers to have a visualization of our OData service. There are paid/online variants like http://www.pragmatiqa.com/product_xodata.html but in our case our

Breeze $filter projections

老子叫甜甜 提交于 2019-12-06 16:06:11
I am having an issue trying to filter data because breeze is adding the $filter clause at the end of the URL and the WCF\odata service is throwing filter cannot be after select clause. public IQueryable<order> Orders() { string owner= Membership.GetUser(Thread.CurrentPrincipal.Identity.Name).owner; IQueryable<Consigne> q = this.db.Consignes // .AddQueryOption("Dest", dest) .Where(x => x.Owner == owner) .Select(f => new order{ Name= f.Name, Address1 = f.Address1, Address2 = f.Address2, Address3 = f.Address3 }); return q; } I'm already limiting the result set with the server side Where clause

OData:Wildcard (startswith) filtering for number (ID) fields in the url request

这一生的挚爱 提交于 2019-12-06 15:08:20
I've been researching a way to perform fuzzy searches for my numerical ID fields of my entity via OData and JavaScript. So far, I have not found the answer I am looking for. I can filter other edm.string columns perfectly using the "Startswith" filter option, however when i attempt to pass in any other non-string type, I get a type error response from the server back. In applications that I control the database, I was successfully able to get around this, by creating views I need and converting the numerical type of the view to a string. However, this seems a bit overkill to go out of my way

Is it Possible to Query Multiple Databases with WCF Data Services?

ぐ巨炮叔叔 提交于 2019-12-06 12:52:14
I have data being inserted into multiple databases with the same schema. The multiple databases exist for performance reasons. I need to create a WCF service that a client can use to query the databases. However from the client's point of view, there is only 1 database. By this I mean when a client performs a query, it should query all databases and return the combined results. I also need to provide the flexibility for the client to define its own queries. Therefore I am looking into WCF Data Services, which provides the very nice functionality for client specified queries. So far, it seems