Implementation > EBICS > EBICS Server > EBICS Server tools > FEX Java API

FEX Java API

Overview

Locating the API

Installing the API

Implementing the API

Using the test samples

Overview

The FEX Java API provides tools to perform tasks on the EBICS Server. These tools enable you to:

Locating the API

The FEX Java API is delivered in the FEX installation package, in the form of a ZIP file.

The file is located in the FEX installation package at:

\EbicsServer_VX.X.X\binaries\FEX-Java-Api-X.X.X.zip

Installing the API

Copy the file FEX-Java-Api-X.X.X.zip from the FEX installation package to your local machine, and unzip the file.

After you unzip the package you obtain the following folders:

Implementing the API

To use the EBICS Java API, execute the following steps:

  1. Create a program to configure and initialize the API, and manage the transaction with the EBICS Server. You can use the following code as a model:
  2. generalProcess()

    {

    /* Define Configuration object */

    Configuration configuration = new Configuration("localhost", 1099, ConnectionType.JBOSS, "admin", "start".toCharArray());

    EbicsApi api = EbicsApi.getInstance();

     

    /* Initialize API */

    api.init(configuration, "myuser");

     

    /* Start Configuration object */

    Transaction transaction = api.getContext("myuser").startTransaction();

    try

    {

    System.out.println("Create a new bank");

    /* Create new bank TEST */

    Bank bank = new Bank();

    bank.setName("TEST");

    bank.setHostid("TEST");

    bank.setLongIds(true);

    bank.setHashValidationLength(1);

    bank.setUrl("https://localhost:8443/ebics/EbicsServlet");

    bank.setEbicsHostId("TEST");

     

    /* Persist new bank TEST */

    BankManager.getInstance().persist(bank, cp);

     

    /* Confirm the current transaction */

    api.getContext("myuser").terminateTransaction(transaction);

    System.out.println("Operation successful.");

    }

    catch (Exception e)

    {

    /* Cancelled the transaction */

    api.getContext("myuser").cancelTransaction(transaction);

    System.out.println("Operation failed.");

    }

    }

  3. Enter values in the /* Define Configuration object */ section of the code to define the connection at the EBICS Server:
  4. For the variable Type Enter
    Hostname String The host name or IP address of the EBICS Server.
    Port Integer Port of the bootstrap.
    ConnectionType Enumeration The type of EBICS Server (JBoss, WebSphere, WebLogic).
    login String The login of the user used to connect to EBICS Server.
    Password Array of char The password of the user used to connect to EBICS Server.
  5. Enter values in the /* Initialize API */ section of the code to create the connection with the application server:
  6. For the variable Type Enter
    configuration Configuration Instance of the configuration object.
    userId String The identifier of the connection.
  7. Edit the transaction section of the code to execute an operation on the EBICS Server. The model code above:

Using the test samples

Delivered samples

After you unzip the API delivery package on your machine, the following sample files are available in the folder:

samples\com\axway\fex\ebics\sample:

Classes Description
ReleaseKey.java Releases a key.
SampleAccount.java

Creates an account entity with its properties (IBAN, Code BIC …). Deletes an account. Updates account properties. Finds an account by IBAN.

SampleBank.java

Creates a bank entity with its properties (Name, Host-Id …). Deletes a bank and dependent entities. Updates bank properties. Finds a bank by name or host-id.

SampleCustomer.java

Creates a customer entity with its properties (Name, City, Street …). Associates accounts and order types. Deletes a customer and the dependent entities. Updates Customer properties. Finds a customer by name. Returns the list of account and associated order types.

SampleOrderType.java

Creates fetch and send entities with their properties (Name, handler …). Deletes the objects. Updates the entity object properties. Finds the entity objects by name.

SampleUser.java

Creates a user entity with its properties (Name, Mail, City …). Associates accounts and order types. Deletes a user. Updates user properties. Finds a user by name. This object can also return the list of accounts and associated order types.

Contains functions to compare and release the certificates.

Using the samples

  1. Edit the samples to correspond to your production environment (hostname, port,…).
  2. Set the classpath.
  3. Compile the samples.
  4. Execute the samples.

Setting the classpath

General configuration

Set your classpath to include the following JAR files:

Additional configuration for WebSphere and WebLogic

Before you can use the Java API in a WebSphere or WebLogic environment, you must perform some additional configuration steps. For details, see Specific application server configuration.

Compiling

After you set the classpath, from the \samples directory, enter the following command:

javac -d . com/axway/fex/ebics/sample/*.java

This command generates class files in the directory: com/axway/fex/ebics/sample.

Executing the samples

To run samples, navigate to the samples directory and enter the following command:

UNIX:

java -cp .:$CLASSPATH com.axway.fex.ebics.sample.XXXX

WINDOWS:

java -cp .;%CLASSPATH% com.axway.fex.ebics.sample.XXXX

Where: XXXX is the name of the sample.

Executing samples in a WebLogic environment

If you are using the API in a WebLogic environment, add the following VM arguments:

-Dweblogic.jndi.enableDefaultUser=true -Dsun.lang.ClassLoader.allowArraySyntax=true

The command line is then:

java -Dweblogic.jndi.enableDefaultUser=true -Dsun.lang.ClassLoader.allowArraySyntax=true -cp .;%CLASSPATH% com.axway.fex.ebics.sample.XXXX

Where: XXXX is the name of the sample.

Related topics

Specific application server configuration

Supplier service

Supplier command line

Injector

Purge command line

Encryptor command line