wcf-data-services

Self Hosted WCF Data Service - Specify IP Address to Listen on?

拟墨画扇 提交于 2019-12-24 15:06:21
问题 I've written a WCF Data Service that is self hosted in a Windows console application. The service is initialised with the following code: static void Main(string[] args) { DataServiceHost host; Uri[] BaseAddresses = new Uri[] { new Uri("http://12.34.56.78:9999")}; using (host = new DataServiceHost( typeof( MyServerService ), BaseAddresses ) ) { host.Open(); Console.ReadLine(); } } When I run this, the console app runs and appears to listen on 0.0.0.0:9999 and not 12.34.56.78:9999. Does this

How do I configure ASP.net MVC to Scaffold using ADO.net dataservice?

和自甴很熟 提交于 2019-12-24 11:18:13
问题 Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work out of the box is extremely easy. What tweaks would you make to make it work with ADO.net Data Services? 回答1: On http://www.codeplex.com/aspnet there's a project for using ASP.NET Dynamic Data with ASP.NET MVC. 回答2: I have customized the MVC Scaffolding templates to scaffold against a WCF Data Services Context (ADO.NET Data Services, oData, which they would stop changing the name!). You can find the

Can I use a complex datatype with an EF-provided WCF Data Services without telling EF about it?

旧巷老猫 提交于 2019-12-24 10:49:37
问题 I am using an Entity Framework-provided WCF DataService to expose an OData endpoint. I want to create a Service Operation that returns a new type. But I get: The exception message is 'Unable to load metadata for return type 'System.Linq.IQueryable 1[MyNamespace+MyNewType]' of method 'System.Linq.IQueryable 1[MyNamespace+MyNewType] FlightHours()'.'. See server logs for more details. How can I let the DataService know I want it to grok MyNewType? Do I have to hackily make a fake entity on the

WCF Data Services : 400 Bad Request when saving lots of changes

回眸只為那壹抹淺笑 提交于 2019-12-24 08:48:05
问题 I have a client that creates thousands of entities and sends it over to the service like so : for(int i=0;i<99999999; i++) { var contract = new Contract { Id = i, Name = "Ctr" + i.ToString() , ... } service.AddToContracts(contract); } svc.SaveChanges(SaveChangesOptions.Batch); the problem is that when I try to save the changes, I get the following exception : "400 - Bad Request" 回答1: WCF Data Services isn't very good at writing large amounts of data. I got into trouble about a year ago when

Can we use msmq messaging with wcf data service

非 Y 不嫁゛ 提交于 2019-12-24 06:49:44
问题 I have a Wcf Data service exposing entities from Ado.net entity framework. I would like to know whethere I can use msmq messaging with my data service. After searching on internet i could find links for using with a wcf service only. Please provide some links with a sample. 回答1: No you cannot. WCF Data Services is using HTTP/REST only - it cannot be used over any other protocol or with any other binding. MSMQ is only available when you use "regular" WCF services that use the SOAP protocol for

Authenticating WCF DataServices

丶灬走出姿态 提交于 2019-12-24 06:31:04
问题 I am trying to authenticate calls to a WCF DataServices service via Silverlight. Essentially, when a user logs in they get a special hash which should be embedded in the headers of every request to the WCF DataServices. Currently use this as a check via a QueryInterceptor method eg [QueryInterceptor("Orders")] public Expression<Func<Orders,bool>> OnQueryOrders() { string hash = WebOperationContext.Current.IncomingRequest.Headers.Get("MyHeader"); if(!TestHash(hash)) { return o => false; } else

WCF Data Services Entity Framework

╄→гoц情女王★ 提交于 2019-12-24 05:32:05
问题 I came across this question in Stackoverflow (because I am getting the same exception) Upgraded to EF 6 (RTM) - Getting System.Data.Entity.Core.Objects.ObjectContext cannot be used for return type System.Data.Objects How can I use the WCF Data Services Entity Framework Provider? I cannot find that Nuget package. Was it removed? Am I doing something wrong? 回答1: Dumb question sorry this is the reason: 来源: https://stackoverflow.com/questions/32191112/wcf-data-services-entity-framework

WCF Data Services Entity Framework

邮差的信 提交于 2019-12-24 05:31:10
问题 I came across this question in Stackoverflow (because I am getting the same exception) Upgraded to EF 6 (RTM) - Getting System.Data.Entity.Core.Objects.ObjectContext cannot be used for return type System.Data.Objects How can I use the WCF Data Services Entity Framework Provider? I cannot find that Nuget package. Was it removed? Am I doing something wrong? 回答1: Dumb question sorry this is the reason: 来源: https://stackoverflow.com/questions/32191112/wcf-data-services-entity-framework

ADO.NET Data Services - Uploading files

二次信任 提交于 2019-12-24 04:53:33
问题 I am trying to write REST web service through which our clients can upload a file on our file server. IS there an example or any useful links which I can refer for any guidance? I haven't seen many examples of POST operation using ADO.NET data services available. 回答1: I've uploaded a file to ADO.NET dataservices using POST although I'm not sure whether it's the recommended approach. The way I went about it is: On the dataservice I've implemented a service operation called UploadFile (using

Could not load file or assembly 'System.ServiceModel.Web, Version=4.0.0.0'

独自空忆成欢 提交于 2019-12-24 03:27:15
问题 Could not load file or assembly 'System.ServiceModel.Web, Version=4.0.0.0' or one of its dependencies. The system cannot find the file specified. I am new with visual studio 2013 and I am trying to make wcf data service with .edmx but I could not made my wcf data service due to above error. Myservice.svc File in visual studio 2013 <%@ ServiceHost Language="C#" Factory="System.ServiceModel.Activation.WebServiceHostFactory, System.ServiceModel.Web, Version=4.0.0.0" Service="_4669.MyService" %>