-
Notifications
You must be signed in to change notification settings - Fork 12
Wilma Service API library for .NET
A new library is introduced recently in order to communicate with Wilma Application by using a .NET package.
Its name is wilma-service-api-net, and it is available both from the source and can be referenced directly from NuGet.
Get wilma-service-api-net from NuGet, type into Package Manager Console and run: Install-Package wilma-service-api-net
Reference to wilma-service-api-net:
using epam.wilma_service_api;
The available versions are accessible here.
First of all, you need to build wilma-service-api-net from its source. To build it easily, just use Visual Studio Community Edition 2015, open the solution file from wilma-service-api-net folder, and build it. Command line build is also possible on both Windows (by using MSBuild.exe) and on Linux platforms (using monodevelop and xbuild).
The following example code shows how to connect to a running Wilma instance, and how to get version information from it.
// Create WilmaServiceConfig, and WilmaService
var wsConf = new WilmaServiceConfig("host_name", portnumber);
var ws = new WilmaService(wsConf, new Logger());
// Call the first API method to see if wilma is running:
ws.GetVersionInformationAsync().ContinueWith(res => { Console.WriteLine(res.Result); });
API documentation is generated from the XML comments, placed in the code. The XML doc is converted to Markdown (MD) by the Vsxmd 1.1.0 NugetPackage. See the generated API description here.
- Open wilma-service-api solution in Visual Studio, update the AssemblyInfo.cs file
- Rebuild Solution wilma-service-api as Release
- update wilma-service-api-net.nuspec file (version, releaseNotes)
- open command prompt, and go to folder of wilma-service-api-net.csproj file
- prepare nuget.exe -> have it in this folder and ensure that it is unblocked, see
- run ´nuget.exe pack´ - this results in a successfully created package: wilma-service-api-net.x.x.x.nupkg
- get a valid apikey (from nuget.org)
- run ´nuget setApiKey <apikey>´ where is the API Key of the NuGet account you want to publish it.
- run ´nuget.exe push wilma-service-api-net.x.x.x.nupkg <ApiKey> -Source https://api.nuget.org/v3/index.json´
See more instructions at https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio-net-framework
Note: NuGet package creation and publishing is possible under Windows only, because the Linux version of nuget.exe misses the 'pack' feature.