-
Notifications
You must be signed in to change notification settings - Fork 28
1.1 Create an OData V4 client app in Visual Studio 2012
This section is a tutorial about how to create a client application for the OData V4 service with ODataCpp using Visual Studio 2012. The ODataCpp client libraries currently only supports Visual Studio 2012. We'll add more support soon.
Suppose you already have your ODataCpp client libraries and code generation tools built. If you haven't, please refer to the README file for instructions.
- Navigate to the path of where the built libraries and tool are located
Open Command Prompt (cmd.exe) or PowerShell and type in the following command to navigate to the location:
cd <Home>\odatacpp\output\<Configuration>
<Home>
is the path where your odatacpp folder is located and <Configuration>
is the build configuration you've chosen to build your library (either "Debug" or "Release"). In this tutorial, we chose "Release" as the build configuration.
- Run the code generation tool to generate the proxy
Type in the following command in Command Prompt or PowerShell
.\odata_codegen_tool.vs11.exe <ProxyFileName> <ServiceURL> <Username> <Password>
<ProxyFileName>
is the name you want for the .h and .cpp files of the proxy code. <ServiceURL>
is the URL of the service document of the target OData service. <Username>
and <Password>
are the credential for accessing the service in case it requires authentication.
In this tutorial, we want to build a client application for the TripPin service published on www.odata.org and it doesn't require authentication, so we type in the following command:
.\odata_codegen_tool.vs11.exe TripPinService http://services.odata.org/v4/TripPinServiceRW
and we get the following two proxy files:
[To insert an image]