WCF Client

The API is based on Windows Communication Foundation (WCF). ASM provides a WCF service and exposes an end point which can be accessed by third party applications to call standard ASM transactions.

Limited Support/End of Life Capabilities

The Classic API has been replaced by the Alemba RestFul API. While we will continue to support the Classic API for clients that are still using it, no further development will be done.

If you need to request a hotfix or support for these features, please contact Alemba Support

This end point is in the location

http://<machinename>/<VirtualDirectory>/ServiceManager.svc

To access this end point, you must create a WCF client and add it to your web application.

This section outlines the relevant steps which you can undertake to create a WCF client, and use this in a third party application to access the API. All examples have been created using Microsoft Visual Studio and have been written in VB.NET.

Prerequisites

In order to access the Classic API, you should make sure that .NET 4.5 or later is installed on the system on which you are building your third party application.

Generating a Client Class

You can use the ServiceModel Metadata Utility Tool (svcutil.exe) to create a client class. This is the class which will be used to call the web service. The client class output consists of a configuration file and a code file. These need to be added to your third party application project.

To generate a client class, you must first:

  • Set your environment variable to the Visual Studio compiler

  • Use svcutil.exe to generate a client class.

Setting the Environment Variable

Before using svcutil.exe to generate a client class, Microsoft recommends that you set the Visual Studio compiler vcvarsall.bat batch file as an environment variable.

To do this, create a batch file (for example, myBatchFile.bat) that contains the following command:

%comspec% /k ""c:\Program Files\Microsoft Visual Studio 9.1\VC\vcvarsall.bat"" x86

The example above points to the Vsvarsall.bat location assuming a Microsoft Visual Studio 9.1 installation. If you are using a different instance of Microsoft Visual Studio, you should update the command above to point to the equivalent location of the Vcvarsall.bat batch file.

For more information on setting your environment variable for command line builds, see:

Using Svcutil.exe to Generate a Client Class

Once you have set your environment variable, use Svcutil.exe to generate a client class. To do this, run the following from the command prompt:

svcutil /t:code /language=VB /messageContract http://<machine_name>/<virtual_directory>/ServiceManager.svc /out:ISMAPI.vb /config:ISMAPI.config

This will output the files ISMAPI.vb and ISMAPI.config; these files contain the client class. You can change these to your required output names.

For more information on using svcutil.exe including an explanation of options, see:

Adding Client Class Files

You should have two output files:

  • A configuration file

  • A code file

Output Configuration File

For the output configuration file (ISMAPI.config using the above example), find the <System.ServiceModel> section and add this to your web.config / app.config configuration with the correct endpoint address.

The endpoint address is in the format: http://<machine_name>/<virtual_directory>/ServiceManager.svc

Output Code File

For the output code file (ISMAPI.vb using the above example), make sure you add this to your third party application project. If you are creating a web application using Visual Studio 2008, this will be under the App_Code section.

Creating Client and Access API

From the third party application project, use the client class to create the code that will access the Classic API.

Example Login

The following VB.NET example demonstrates how to create a Service Client and log into the application using the ASM LogIn Transaction.

Copyright 2023 Alemba, ASM EOS 10.4