odata

Create annotation to a contact entity in Microsoft Dynamics CRM by API

北战南征 提交于 2019-12-17 19:57:42
问题 This question is related to Microsoft Dynamics CRM 2015, that I'm calling through API. I create contact entity: POST [organization URI]/api/data/contacts Content-Type: application/json; charset=utf-8 Accept: application/json { "emailaddress1": "myemail@example.com", } It works, I see new record, after I log into the panel. And I can call it through the API: [organization URI]/api/data/contacts(f76e4e7c-ea61-e511-80fd-3863bb342b00) { "@odata.context":"[organization URI]/api/data/$metadata

Consume Odata Service and get result in JSON

只愿长相守 提交于 2019-12-17 19:51:58
问题 I am consuming odata service using DataServiceContext and want to return data in json format. I am looking something like this: Odata Query with DataServiceContext and get result as json If I try to add any request header in the sending request event. I can't see that header in fiddler. Although the event is firing which I have confirmed. I came across "context.Format.usejson" and try to search it but didn't find anything which I can understand. Can somebody help me please ? Using ODataLib to

How do I interact with OData from Java?

我怕爱的太早我们不能终老 提交于 2019-12-17 18:16:48
问题 OData is Microsoft's repackaging of its Astoria (now WCF Data Services) RESTful query/update protocol. If I want to use Java to create an OData compatible data source, how do I do that? Similarly, if I want to consume an OData data source from Java, how do I do that? http://www.odata.org/ Partial answer below. The OData website suggests that Restlet supports OData. Restlet's API documentation mentions the org.restlet.ext.odata package. www.restlet.org/ www.restlet.org/documentation/snapshot

ASP .NET MVC 4 WebApi: Manually handle OData queries

。_饼干妹妹 提交于 2019-12-17 17:26:02
问题 I have a Web Service made using the WebAPI provided by ASP .NET MVC 4. I know that the layer on top of which WebAPI works automatically handles OData Queries (such as $filter , $top , $skip ), but what if I want to handle the filtering by myself? I don't simply return data from my database, but I have another layer which adds some properties, makes some conversions etc. So querying ALL of my data, converting them and returning them to the WebAPI class for OData filtering isn't just good

How can I pass filter parameter in OData read method

半城伤御伤魂 提交于 2019-12-17 17:15:28
问题 I need to pass a parameter in my OData. The URL has to be like this: http://my_gateway_system:port/sap/opu/odata/sap/ZGW_TRANSF_APPROVAL_SRV_02/ztest_nameset('RUBENS') Below is my code: var sServiceUrl = "http://<my_gateway_system>:<port>/sap/opu/odata/sap/ZGW_TRANSF"; var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true, "username", "password"); var oJsonModel = new sap.ui.model.json.JSONModel(); oModel.read("/ztest_nameset('RUBENS')", null, null, true, function(oData, response)

How to get Web API OData v4 to use DateTime

与世无争的帅哥 提交于 2019-12-17 15:29:01
问题 I have a fairly large data model that I want to expose using Web API OData using the OData V4 protocol. The underlying data is stored in a SQL Server 2012 database. That database has many DateTime columns in it. As I was wiring it up I got an error that System.DateTime is not supported. So here is my question, what can I do to get my DateTime columns to be seen in the OData feed? NOTE: I am not able to go back and change all my columns to DateTimeOffset columns. I tried changing the type of

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 to wisely combine shingles and edgeNgram to provide flexible full text search?

▼魔方 西西 提交于 2019-12-17 04:01:30
问题 We have an OData-compliant API that delegates some of its full text search needs to an Elasticsearch cluster. Since OData expressions can get quite complex, we decided to simply translate them into their equivalent Lucene query syntax and feed it into a query_string query. We do support some text-related OData filter expressions, such as: startswith(field,'bla') endswith(field,'bla') substringof('bla',field) name eq 'bla' The fields we're matching against can be analyzed , not_analyzed or

Removing Objects With a Relationship from DbContext

只愿长相守 提交于 2019-12-14 04:10:02
问题 I recently started learning Entity Framework and OData, and while there has been a learning curve, most problems seemed possible to solve without asking for help. This problem that I have has stumped me for over a day and I cannot find in the documentation what I am looking for. The project is a simple Movie Database; Movies have a director and actors, and 'Film Professionals' have directing and acting credits for movies. When I try to delete a movie though, either I get an error saying:

OData $select not working on Web API

天涯浪子 提交于 2019-12-14 02:06:18
问题 I'm trying to use OData to return a smaller, paginated result set from my web API. I'm modifying a large, existing API so I would like to be able to do this for only this one controller and method, preferably without using the extensive 'Microsoft ASP.NET Web API OData' package from NuGet, EdmModels, etc.. I've got $top and $skip working fine in my method below, but my $selects are being ignored. My method: [Queryable(AllowedQueryOptions = System.Web.Http.OData.Query.AllowedQueryOptions