wcf-data-services

Tool to visualise OData WebAPI / WCF Data Service?

£可爱£侵袭症+ 提交于 2019-12-08 06:42:18
问题 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... 回答1: LINQPad implements an "OData / WCF Data Services" connector. So, you can explore metadata and query data quikly. 回答2: I had the same issue that I wanted our customers to have a visualization of our OData

Empty HttpContext.Current.Request.Files in WCF Service

若如初见. 提交于 2019-12-08 03:10:07
问题 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) {

WCF DataService over Https

☆樱花仙子☆ 提交于 2019-12-08 03:08:00
问题 I am developing a WCF DataService that's self-hosted inside a Windows Console Application. I want to activate my service over Https (i.e. SSL) instead of Http. How can I do that? Thanks 回答1: First Creating a CA Certificate on Windows (use Visual Studio Command Prompt): makecert -sv SignRoot.pvk -cy authority -r signroot.cer -a sha1 -n "CN=Dev Certification Authority" -ss my -sr localmachine Now put the certificate in the "Trusted Root Certification Authority" in Windows Key Store. That can be

How do I lock down a .net 4.0 WCF Data Service

泄露秘密 提交于 2019-12-08 02:53:35
问题 I've had a WCF Data service published for about 2 months. It's 100% been hacked already. I even noticed the service published on twitter! Luckily my site was under development and the user entity was only about 80 beta testers. Still this is a pretty big problem. With the power of E.F. Navigation properties anyone can easily write a script to download all my user data and my valuable domain data that no-one else has. I want to provide non-authenticated access and do things like: Limit what

How can I setup OData and EF with out coupling to my database structure?

心已入冬 提交于 2019-12-08 02:25:32
问题 I really like OData (WCF Data Services). In past projects I have coded up so many Web-Services just to allow different ways to read my data. OData gives great flexibility for the clients to have the data as they need it. However, in a discussion today, a co-worker pointed out that how we are doing OData is little more than giving the client application a connection to the database. Here is how we are setting up our WCF Data Service (Note: this is the traditional way) Create an Entity

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

一个人想着一个人 提交于 2019-12-08 02:16:52
问题 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

WCF Data Services Error - 302 Moved on SaveChanges() related to HTTPS + Load Balancer?

巧了我就是萌 提交于 2019-12-07 19:59:19
问题 Problem: DataServiceContext.SaveChanges() fails with "302 - moved" response. Background/Suspected Cause: Load balancer! - We recently changed our infrastructure so that our web servers now sit behind a load balancer which also handles the ssl. Clients address the service as HTTPS but IIS ends up processing HTTP requests since the SSL was done by the load balancer(I am sure most of you are familiar with this type of setup). Anyway, what we end up with is a feed that contains URIs that are

Synchronous ADO.NET dataservices calls in Silverlight

只愿长相守 提交于 2019-12-07 18:48:27
问题 I'm using ADO.NET dataservices in a Silverlight application and since the silverlight libraries don't support the ToList() call on the IQueryable I thought it might be possible to create an extension method around this called SilverlightToList(). So in this method I'm calling the BeginExecute method on my context as shown below: var result = context.BeginExecute<T>(currentRequestUri,null,context); result.AsyncWaitHandle.WaitOne(); return context.EndExecute<T>(result).ToList(); The problem is

How to send list of objects to WCF service?

孤人 提交于 2019-12-07 16:41:10
问题 I'm building WCF service and I would like to accept List as a parameter to one of my method. Here is my code: [ServiceContract] public interface IProductService { [OperationContract] int InsertProducts(List<Product> products); } [DataContract] [KnownType(typeof(List<Product>))] public class Product { [DataMember] public int ProductId{ get; set; } [DataMember] public string ProductName{ get; set; } [DataMember] public List<Product> Products { get; set; } } When I run service it gives me an

WCF DataService with Entity Framework: TimeSpan support

ぃ、小莉子 提交于 2019-12-07 12:27:13
问题 I am trying to create a WCF Data Service over an Entity Framework Object context that exposes a number of System.TimeSpan properties. However, when I try to access the service, I get the following error: 'The property 'ScheduledDepartureTime' on type 'DepotRoute' is of type 'Time' which is not a supported primitive type.' I have tried using DataServiceConfiguration.RegisterKnownType(typeof(TimeSpan)) as well as DataServiceConfiguration.EnableTypeAccess(typeof(TimeSpan).FullName) but neither