wcf-data-services

How to handle json DateTime returned from WCF Data Services (OData)

梦想的初衷 提交于 2019-12-17 09:41:39
问题 I believe I am missing something obvious here. When I request a JSON response from an OData service I get a different result for the DateTime properties than I do when I request XML. I'll use the NerdDinner OData feed as an example. JSON: http://www.nerddinner.com/Services/OData.svc/Dinners(1)?$format=json "EventDate": "\/Date(1235764800000)\/" XML: http://www.nerddinner.com/Services/OData.svc/Dinners(1) <d:EventDate m:type="Edm.DateTime">2009-02-27T20:00:00</d:EventDate> When I do an alert

How do i Consume WCF Data Service?

折月煮酒 提交于 2019-12-14 03:42:43
问题 i have created a wcf service but i have used 3 projects for it; 1) ServiceLibrary (WCF library) 2) Web 3) ConsoleTestClient my ServiceLibrary app.config file looks like this; <system.serviceModel> <services> <service name="MrDAStoreJobs.ServiceLibrary.AdvertisementService"> <clear /> <endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="" contract="MrDAStoreJobs.ServiceLibrary.Interface.IAdvertisementService" /> <endpoint name="mexHttpBinding" contract="IMetadataExchange"

Routing in WCF data services

删除回忆录丶 提交于 2019-12-13 16:26:53
问题 I am creating a WCF data service on top of a EF 4.1 code first data model that goes against a multi-tenant database. In order to enforce the rules of accessing the multi-tenancy I want to require a string id (that is required by all of our MVC-based REST services) be passed as part of the url route. So, for example, right now I have a service route like this: http://mysample.net/mysamplesvc.svc/Users That returns all users in the db w/o a filter. I want to partition this by client by

paging through NetFlix odata results

大憨熊 提交于 2019-12-13 15:51:07
问题 I am playing around with the Netflix odata service to get a better understanding of how to consume odata data. In VS 2010 I added a service reference to the NetFlix odata service. I then wrote this code which returns only some of the data. var cat = new NetflixCatalog(new Uri("http://odata.netflix.com/v1/Catalog/")); var x = from t in cat.Titles where t.ReleaseYear == 2009 select t; foreach (Title title in x) { ProcessTitle(title); } I looked at the uri generated for the call and ran it in a

How to properly create and link a one-to-one relationship in single POST request with OData

不羁岁月 提交于 2019-12-13 14:13:27
问题 In the OData:Operations documentation, section 2.4 fourth paragraph down, it reads when creating an entity with POST it is also possible to create a link within the same request. However, I'm having trouble trying to make this work. A similar question has been asked about many-to-many linking while creating and it looks like that particular scenario isn't possible without a batch request. Below is the scenario I'm trying to create using this sample OData read write service. Create a new

how to generate client proxy class of a wcf service that will work in the .net 2.0

佐手、 提交于 2019-12-13 12:16:20
问题 I have to use a wcf service in the ssis script component which is developing in BIDS 2005. For this i have generated the proxy class of that service using svcutil.exe . After attaching the proxy class in the script component it has error of some class such as System.Runtime.Serialization.DataContractAttribute is not defined. Any suggestion how can i resolve this issue.. Or can wsdl is used to genrate proxy class of wcf service. so that it can be used in the .net 2.0. Thanks 回答1: Finally after

Breeze Webapi Update Projections

一世执手 提交于 2019-12-13 07:58:55
问题 Continuing on after my initial WebApi Filtering and paging a projection Dilemma Breeze $filter projections thread I am now trying to update my backend database with little success. Giving the Fact that I am: public IQueryable<ConsigneDTO> Consignees(string refname) { IQueryable<ConsigneDTO> q = this.db.Consignes .Where(x => x.Refname == refname) .Select(f => new ConsigneDTO {Refname = f.Refname, Consignee = f.Consignee, Address1 = f.Address1, Address2 = f.Address2, Address3 = f.Address3});

How do I increase the size of data sent to ADO.Net Data Services?

人盡茶涼 提交于 2019-12-13 07:37:02
问题 I have a data service that takes a byte array. I then have a web page that attempts to send a file to that data service. If the file is small (say 50kb) then everything functions as expected, however if the file is large (anything over 100kb) I get a "BadRequest" error message on the save change call for the data service. Is there a way to enable larger data sizes to be passed to the data service? EDIT (more details): I've set maxRequestLength higher and tried some webHttpBinding to increase

Using ODataLib to call a WCF Data Services service operation and JSON

杀马特。学长 韩版系。学妹 提交于 2019-12-13 05:51:03
问题 I have searched far and wide and been completely unable to find any good samples or tutorials of how to call service operations using the ODataLib. I've seen several that tell me how to get entities and entity sets and that's great, but in order to call a service operation. I'm almost positive that I need to use something other than an ODataEntry , ODataFeed or ODataNavigationLink object. I've opened up the library in JustDecompile and see classes like ODataAction and ODataFunction but can't

Why can't value of type List(Of Integer) be converted to Integer when sending value to WCF service?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 05:43:09
问题 Client code: Public Sub sendEmpValue(name As String, value As List(Of Integer)) Dim serviceObject As New Service.GetEmployeeClient serviceObject.DoWork(name, value)** getting error at the value** End Sub Service code: Sub DoWork(name As String, value As List(Of Integer)) Implements IGetEmployee.DoWork End Sub 回答1: The DoWork method expects an Integer() which is an array of integers . The List(Of T) class has got a function called ToArray() which will return the list as an array. Call that and