Altova MapForce Server 2024 

The IServer interface creates a new MapForce Server object instance, and provides access to the MapForce Server engine.

 

If you are using C++ under COM platform, the name of the main interface is IServer. If you are using a .NET language such as C# or VB.NET, the name of the main interface is Server.

 

Properties

Name

Description

APIMajorVersion

Read-only.

Gets the major version of the MapForce Server API. This can be different from the product version if the API is connected to another server.

APIMinorVersion

Read-only.

Gets the minor version of the MapForce Server API. This can be different from the product version if the API is connected to another server.

APIServicePackVersion

Read-only.

Gets the service pack version of the MapForce Server API. This can be different from the product version if the API is connected to another server.

Is64Bit

Read-only.

Returns true if the MapForce Server engine is a 64-bit executable.

LastExecutionMessage

Read-only.

Gets the message received during the last Run command.

MajorVersion

Read-only.

Gets the major version of the product, as number of years starting from 1998 (for example, "20" for Altova MapForce Server 2018).

MinorVersion

Read-only.

Gets the minor version of the product (for example, "2" for Altova MapForce Server 2018 r2).

ProductName

Read-only.

Gets the name of the product (for example, "Altova MapForce Server").

ProductNameAndVersion

Read-only.

Gets the complete name and version of the product (for example, "Altova MapForce Server 2018 r2 sp1 (x64)").

ServerPath

Gets or sets the path of the MapForce Server executable.

ServicePackVersion

Read-only.

Gets the service pack version of the product (for example, "1" for Altova MapForce Server 2018 r2 sp1).

WorkingDirectory

Gets or sets the current directory for running jobs (relative paths will be evaluated against the working directory).

 

Methods

Name

Description

AddCredentialProperty

Adds a property to the current credential (for example, the username, the password, or both). The first argument specifies the property name, and the second argument specifies the property value. Valid property names: username, password. In MapForce Server Advanced Edition, the property name oauth:token is additionally supported.

 

This method must be called after calling BeginCredential() and before calling EndCredential().

AddParameter

Assigns a value to a parameter defined in the mapping. The first argument specifies the name of the parameter as defined on the mapping; the second argument specifies the parameter value.

BeginCredential

Creates a new credential with the name supplied as argument. If you call this method, you must also add properties to it using AddCredentialProperty(), and finally close the credential by calling EndCredential().

ClearCredentialList

Clears the list of credentials set previously. All credentials are valid for the lifetime of the object. Call this method if you need to explicitly clear all of the previously set credentials.

ClearOptions

Clears the list of options previously set through the SetOption method. All options set through the SetOption method are valid for the lifetime of the object. Call this method if you need to explicitly clear all of the previously set options.

ClearParameterList

Clears the list of parameters that were previously set using the AddParameter method.

EndCredential

Closes a credential object that was previously created using the BeginCredential method.

GetOutputParameter

Gets the string output generated by the last run command. Returns null if no output was generated. This function requires a string parameter which identifies the name of the output component in MapForce.

Run

Executes a MapForce Server Execution file (.mfx file). Returns true in case of success; false otherwise.

SetOption

Sets an option before running the mapping. The first argument specifies the name of the option, while the second argument specifies the option value. This method is particularly useful when a mapping was designed to consume Global Resources (see Altova Global Resources). The currently supported options are as follows:

 

globalresourcefile (or gr) - A Global Resource file path. (When this option is specified, then a Global Resource configuration name must also be specified, see next item).

globalresourceconfig (or gc) - A Global Resource configuration name. (When this option is specified, then a Global Resource file path must also be specified, see previous item).

catalog - The path to a custom RootCatalog.xml file. This option enables you to specify a custom catalog file used to resolve URLs used by the mapping. The default catalog is in the etc subdirectory of the program installation directory.

taxonomy-package - The path to a custom XBRL taxonomy package, if one is required by the mapping.

taxonomy-packages-config-file - The path to a custom XBRL taxonomy package configuration, if one is required by the mapping.

 

All set options are valid for the lifetime of the object. If you set an option with the same name twice, the previous option will be overridden. To explicitly clear all options, call the ClearOptions() method.

StopServerProcess

This method stops explicitly the process connected with the COM object, without releasing the object. The process stops implicitly when the COM object is released.

 

Examples

See the following examples that illustrate how to initialize and run MapForce Server in various languages:

 

C++ example

C# example

VBScript example

VB.NET example.

© 2017-2023 Altova GmbH