odata

Windows Phone 7 DataServicesClient Request Headers Accept gzip

依然范特西╮ 提交于 2019-12-12 01:57:22
问题 I have a Windows Phone 7 application that is utilizing the DataServicesClient to access a WCF DataService (ODATA) and I want to ask the service to compress the response. I know if the Request Headers includes "Accept-Encoding" header with the value of "gzip" the WCF DS will compress the response. Is there a way to add this header to the Request when using the DataServicesClient on WP7? The Request Headers collection appears to be readonly. What I would like to be able to do is the following

OData query option $count in $expand not working

旧城冷巷雨未停 提交于 2019-12-12 01:55:23
问题 I tried to use $count in an $expand like this query .../OData/Foo(1)?$expand=Bars($count=true) However count is no where to be found in the result. { "...": "...", "Bars": { "...": "..." } } No error either. I'm using ASP.NET Web API OData 5.4, which is using OData v4. What gives? Not implemented yet? 回答1: This feature hasn't been implemented yet. A related issue has been created https://github.com/OData/WebApi/issues/165 . 来源: https://stackoverflow.com/questions/28967908/odata-query-option

OData v4.0 via ASP.NET WebAPI - Can Excel consume a service?

二次信任 提交于 2019-12-12 01:49:45
问题 I have built a few WebAPIs since it was born, including one supporting OData URL filters when that was new. I see now that OData over WebAPI has matured, I see it can serve service metadata. Is it complete enough for Excel or other OData client tooling to plug and play as if it were a full WCF Data Service (ye olde Astoria)? That's it. Thanks 回答1: It is. In the past you had to do the right configuration or do a workaround to populate the OData feed from Web API correctly, to be able to

Unable to parse odata json responses containing root property “d” using wcf client services 5.3 generator

假装没事ソ 提交于 2019-12-12 01:11:58
问题 I am starting this new thread as a continuation of comments in: Consume Odata Service and get result in JSON The issue that I am facing is that I have upgraded to wcf data services 5.5 and wcf client tools 5.3 as recommended in the thread. And I am trying to perform a simple post to the following JayStorm service: https://open.jaystack.net/c72e6c4b-27ba-49bb-9321-e167ed03d00b/6494690e-1d5f-418d-adca-0ac515b7b742/api/mydatabase/ I generated the client service reference in .Net and am running

DataServiceContext : Update Navigation Collection Property

早过忘川 提交于 2019-12-12 00:54:04
问题 I'm consuming a Odata WebApi.2.1 Service in a Odata v4 client. When I attempt to update the entity, and I'm getting following error: "UpdateRelatedObject method only works when the sourceProperty is not collection" I have below code in my application. public class Customer { int CustomerId; string CustomerName; ICollection<Order> Orders; } public void Save() { foreach (var item in Customer.Orders) { Context.UpdateRelatedObject(Customer, "Orders", item); } Context.UpdateObject(Customer);

Using Odata to get huge amount of data

我是研究僧i 提交于 2019-12-12 00:45:40
问题 I have a data source provider : public class DSProvider { public IQueryable<Product> Products { get { return _repo.Products.AsQueryable(); } } } The repository in the above example currently gets ALL the records (of Products) from DB and then applies the filters, this just does not sound right if you had 50000 requests/sec from a website.How can you limit the repository to just return required info from DB without converting the service to a tightly coupled request option i.e. opposite of

Does Simple.OData.Client support open properties?

自闭症网瘾萝莉.ら 提交于 2019-12-11 20:35:45
问题 I am working with Simple Odata Library https://github.com/object/Simple.OData.Client/wiki I need to define open parameters, but i dont seam to see any definition or documentation for this. Example for clarification: Along with my oData call, i send a parameter called "mode", which i can set to any number between 0-10. My server will know what to do with it. This parameter however is not pre-defined. 回答1: Recent releases of Simple.OData.Client support OData open types, look at examples here:

How to test what data is present in d.data.results when querying CRM 2011 AppointmentSet using JavaScript and REST OData

浪尽此生 提交于 2019-12-11 20:24:56
问题 I am trying to populate a field on my Account form that shows the last Actual End date of the accounts completed appointments. My Query seems to work exactly as I want. I used the Dynamics XRM Tools solution to create my query, but I am unable to handle what happens if for instance the account has no completed activities or I create a new account that has no appointments at all. I am trying to test the value data.d.results returned to my success Method within the ExecuteQuery function of my

OData: Generate the $metadata document from a IEdmModel

匆匆过客 提交于 2019-12-11 19:58:38
问题 I can generate an IEdmModel from a $metadata document with something like this: HttpWebRequest request = HttpWebRequest.CreateHttp("http://services.odata.org/v3/odata/OData.svc/$metadata"); ClientHttpResponseMessage metadataMessage = new ClientHttpResponseMessage((HttpWebResponse)request.GetResponse()); using (var messageReader = new ODataMessageReader(metadataMessage)) { IEdmModel model = messageReader.ReadMetadataDocument(); } Is there a way to do the reverse? Given a IEdmModel generate the

Updating oData via Batch Operation in SAPUI5

烂漫一生 提交于 2019-12-11 19:55:40
问题 I have the following code listed below: oTable = sap.ui.getCore().byId('tableID'); var index = oTable.getSelectedIndex(); if (index > -1) { var currentRowContext = oTable.getContextByIndex(index); var model = oTable.getModel(); var name = model.getProperty("NAME", currentRowContext); var phase = model.getProperty("PHASE", currentRowContext); var originalPhase = Phase; var sequence; var batchChanges = []; jQuery.ajax({ type: "GET", contentType: "application/json", url: "http:/