Web API Client Libraries
You can access the API specification files of a FintechOS instance at the following locations:
- OpenAPI: <host_address>/api/openapi/swagger
- WSDL: <host_address>/Services/ApiService.svc
Create a Web API client library from an OpenAPI or WSDL specification file
When importing WSDL specification files, FintechOS Studio uses the Windows Communication Foundation (WCF) dotnet-svcutil tool to generate the Web API client libraries. Make sure that dotnet-svcutil is installed on the deployment server either as a global tool or as a local tool in the bin directory.
You should install the .Net core runtime version that corresponds to the FintechOS instance, even if there are other versions installed on the machine. For more details regarding the installation, go to https://docs.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide.
Additionally, depending on your .NET Core SDK version, run the following commands:
- For .NET Core SDK 3.0 or above, run:Copy
dotnet tool install dotnet-svcutil --tool-path <WEB_APP_FOLDER>\bin
For .NET Core SDK 2.2 or below:
dotnet tool install dotnet-svcutil --global
- Copy the
<USERPROFILE_FOLDER>\.dotnet\toolsfolder content to
Follow the below steps to create a Web API client library.
- In the Main Menu, go to Ecosystem > Web API Client Libraries.
- In the Web API Client Libraries List page, click Insert.
- Fill in the library's details.
- Name - Enter a name for the Web API client library.
- Description - Optional library description.
- API Type - Select whether the source file uses the OpenAPI or WSDL standard.
- Min Platform Version - Optionally select the oldest API version endpoints you wish to extract from the source file.
- Is Used For Service Pipes (v22.1.2 or later) - Select if the library is used to call external services via Service Pipes. This will automatically manage authorization when a server automation script invokes the library. Otherwise, you will have to add the authorization code in your scripts (for details, see Create a Server Automation Script that Invokes the Web API Client Library).
- API Definition - Paste the contents of the OpenAPI or WSDL specification file.
- Click Save and Reload. After the library is generated, you can review its definitions in the Typescript Definition tab.
- Click Save and Close.
Use a Web API client library in server automation scripts
In your automation script, use the importWebApiClient function to import the Web API client library in a JSON object that contains the API specifications. The object exposes methods matching the API's endpoints and has full IntelliSense auto-complete support.
For details, see the Server SDK Reference Guide.
Add certificate support to WebApi client and WCF client
WebAPI client offers a way for consuming external web services by providing a definition for the external service with an OpenAPI or Wsdl file and import it into the platform and provide an object to use. This feature allows a user to work with web services and web sites that require a certificate authentication for example Certsign.
To do so, the user needs a valid certificate.
There is a method for this process setCertificate which accepts workflow client certificate, this is to actually use a certificate. By using a server method that provides the certificate, this method uses the configurations from web.config. In the web.config file, the certificate needs to be configured by providing a storeLocation, storeName, thumbPrint.