I want to create WCF oData Service (RESTful Service) using U2 Toolkit for .NET and U2 Database. Then I want to consume oData Service in any .NET Client Application.
How to create/consume WCF oData Service (RESTful Service) using U2 toolkit for .NET?
2.1k Views Asked by Tyler Elma At
1
There are 1 best solutions below
Related Questions in REST
- Spring RestTemplate passing the type of the response
- .net rest service with JSON string and consumed with java client
- SuiteCRM how to retrieve all account related contacts
- http status code for failed email send
- cloud foundry - 413 Request Entity Too Large
- Why does PHP add "\r\n" to an empty string?
- WCF Service not accepting multiple body parameters
- How to send Rest GET request that contains "#" value in url parameters?
- Phalcon PHP - RESTful API
- Object of class CS_REST_Wrapper_Result could not be converted to string in CAMPAIGN MONITOR
- purchase individual items and subscriptions in the same PayPal REST API transaction
- Empty Response Received on Android POST Request
- angular load more tweets onclick
- Async vs Horizontal scaling
- Responding to an Office 365 event invite via REST
Related Questions in ODATA
- kendo - datasource - parameterMap does not bind parameters
- Creating Odata Web API application without Entity Framework
- ASP.NET Odata Web API Composable function issue
- What the format should look like for a Function Import Response which returning a simple type?
- Web API: Odata route always returning a 404 response
- Odata post always returns "HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed,"
- solution architecture for an OData / Web API based .Net project
- WCF Data Services, WindowsAzure.Storage and Microsoft.Data.OData version nightmare
- How to wisely combine shingles and edgeNgram to provide flexible full text search?
- Connect to SharePoint Lists with OData
- Freeze a linq IQueryable (as a ToList().AsQueryable() would do)
- Can I create a file to subdirectory on OneDrive for Business with REST API?
- Simple.OData.Client - Unable to invoke Action that accepts entity collection parameter
- oData deserialization issue in application
- Accessing JSON object in SAPUI5 via xsodata
Related Questions in U2
- Is there a native way to convert to UTC time in UniVerse 11.2.4+?
- What is the most efficient way to copy UniDataSet to SQL Server?
- How can I handle JSON strings in UniData?
- U2 Toolkit Insert function creating blank multi-values
- Linux dropping escape characters
- U2 Visual Studio 2013 Add-in
- Connect to PickBasic from Java
- run SQL script using Rocket Universe from AIX command line (uvsh)
- Rocket Universe Data load
- Writing to UniVerse Linked Server from SQL Server via ODBC
- How do I access MultiValue data from U2 Toolkit for .NET?
- U2 Toolkit for .NET - Entity Framework Sample "EntityFramework_CodeFirst" not working
- U2 Toolkit for .NET - Entity Framework Sample "EntityFramework_CodeFirst2" not connecting
- UniData UniQuery - two WITH
- Is there an R package for connecting to U2 / Universe / PICK?
Related Questions in U2NETDK
- What is the most efficient way to copy UniDataSet to SQL Server?
- U2 Toolkit Insert function creating blank multi-values
- U2 Visual Studio 2013 Add-in
- How do I access MultiValue data from U2 Toolkit for .NET?
- U2 Toolkit for .NET - Entity Framework Sample "EntityFramework_CodeFirst" not working
- U2 Toolkit for .NET - Entity Framework Sample "EntityFramework_CodeFirst2" not connecting
- Accessing UniData through .net
- How do I move U2 Database into SQL Server 2012 using U2 Toolkit for .NET, SSIS and Import/Export Wizard?
- Merging Tables/Files
- Universe Entity Framework very slow to select
- How to do fetch pages when querying universe database using .net sdk and sql
- How to create/consume WCF oData Service (RESTful Service) using U2 toolkit for .NET?
- Retrieve all records from universe database using universe basic subroutine
- How to use U2.Data.Client for .NET Core Web API?
- What is the fastest way to GET a list of records from Universe DB file using C#.NET?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Please see my answer below:
Overview
WCF Data Services exposes entity data as a data service. This entity data can be created from U2 Database using U2 Toolkit for .NET. This topic shows you how to create an Entity Framework-based data model in a Visual Studio Web application that is based on an existing database and use this data model to create a new WCF oData service (RESTful Service). You can consume WCF oData Service in different .NET application such as:
Installation
You need to install U2 toolkit for .NET v 1.2.0. It contains U2 ADO.NET Provider and U2 Database Add-ins for Visual Studio
Create Entity Data Model with existing U2 Account
We will use U2 UniVerse ‘s sample database called “HS.SALES”. 1. Create ASP.NET Web Application called ‘U2_WCF_oData_WebApplication’
Type the model name and then click Add.
In the Choose Model Contents dialog box, select Generate from database. Then click Next.
Create WCF oData Service (RESTful Service) using the new data model (Customer Model)
public class U2_Customer_WcfDataService : DataService< /* TODO: put your data source class name here */ >
In the code for the data service, enable authorized clients to access the entity sets that the data service exposes. For more information, see Creating the Data Service.
// config.SetEntitySetAccessRule("MyEntityset", EntitySetRights.AllRead);
To test the ‘U2_Customer_WcfDataService.svc ‘ data service by using a Web browser, press Visual Studio ->Debug->StartWithoutDebugging
Consume WCF oData Service (RESTful Service)
Open ‘MainWindow.xaml.cs’ file. Add this line ( yours uri will be different).
private Uri svcUri = new Uri("http://localhost:38346/U2_Customer_WcfDataService.svc/");
Add this line.
U2_WCF_oData_ServiceReference.CustomerEntities ctx = new U2_WCF_oData_ServiceReference.CustomerEntities(svcUri);
Add this line.
cUSTOMERsViewSource.Source = ctx.CUSTOMERs.ToList();
Your competed code will look as below. public partial class MainWindow : Window { private Uri svcUri = new Uri("http://localhost:38346/U2_Customer_WcfDataService.svc/");
}
Set WPF application as ‘Startup Project’. Run WPF Application.