This sample project demonstrates how to use the v2 .NET RESTful Client with C# to accomplish:
- Generating a document
- Retrieving a template's metrics
- Retrieving a template's tag tree
This project consists of 3 main classes that can each be individually ran to show each piece of functionality.
- .NET Installation
- A RESTful Engine Installation
Use the following steps to build and run the sample through Visual Studio.
- Open the .sln file
- Open the App.config file and insert your RESTful Engine URL in the "restful-engine-url" property
- Also in the App.config file and insert your license key in the "license" property
- If you don't have a license key, leave it blank and output will generate with a watermark
- In the "Build" dropdown, select "Rebuild Solution"
- To select which sample file you would like to run, in Visual Studio 2022:
- Open the project properties by right clicking on the project in the Solution Explorer and select Properties
- In the side tag Application > General find the portion called Startup object
- In that dropdown, select the sample class you would like to run
- Save and click Start
Use the following steps to build and run the sample from the command line.
- Open a command prompt in the root directory where the .csproj file is located
- To build the project for a specific file run the following commands:
- For GenerateDocument
dotnet build RESTful-Client-.NET-Sample.csproj -p:StartupObject=RESTful_Client_.NET_Sample.GenerateDocument -t:Rebuild- For RetrieveMetrics
dotnet build RESTful-Client-.NET-Sample.csproj -p:StartupObject=RESTful_Client_.NET_Sample.RetrieveMetrics -t:Rebuild- For RetrieveTagTree
dotnet build RESTful-Client-.NET-Sample.csproj -p:StartupObject=RESTful_Client_.NET_Sample.RetrieveTagTree -t:Rebuild - To run the project, use the command
dotnet run- Alternatively you can run the .dll or .exe file that are produced in the bin/Debug/netX.0/ folder where X is your .NET version
You can find additional information about the v2 .NET RESTful Clients here.