Skip to content

Wilma Service API library for .NET

Tamás Kőhegyi edited this page Feb 10, 2023 · 6 revisions

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.

Using 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.

Using from Source

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).

API calls within your apps

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); });    

Available API calls right now

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.

Creating and publishing the NuGet package (info for service API maintainer)

  1. Open wilma-service-api solution in Visual Studio, update the AssemblyInfo.cs file
  2. Rebuild Solution wilma-service-api as Release
  3. update wilma-service-api-net.nuspec file (version, releaseNotes)
  4. open command prompt, and go to folder of wilma-service-api-net.csproj file
  5. prepare nuget.exe -> have it in this folder and ensure that it is unblocked, see
  6. run ´nuget.exe pack´ - this results in a successfully created package: wilma-service-api-net.x.x.x.nupkg
  7. get a valid apikey (from nuget.org)
  8. run ´nuget setApiKey <apikey>´ where is the API Key of the NuGet account you want to publish it.
  9. 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.