Aurion API Guide Version 10.4 MR23 ?· Aurion API Guide Version 10.4 MR23 ... Running the COM Interface…

Download Aurion API Guide Version 10.4 MR23 ?· Aurion API Guide Version 10.4 MR23 ... Running the COM Interface…

Post on 23-Mar-2019

212 views

Category:

Documents

0 download

TRANSCRIPT

Aurion API Guide

Version 10.4 MR23

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence

Version Control

Version Author Version Description Date

1.0 Aurion Corporation Initial version for 10.4 MR13 02/02/2016

1.1 Aurion Corporation Added EMP_COST_DEL for 10.4 MR23 19/09/2016

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence

Contents

Introduction ............................................................................................................................................. 1

COM Configuration .................................................................................................................................. 1

Technical Overview ............................................................................................................................. 1

Installing aurion10.dll ......................................................................................................................... 2

Running the COM Interface Test Program .......................................................................................... 6

Login Test ........................................................................................................................................ 6

Security Test ................................................................................................................................... 7

Possible Errors when running AurionAPITest-COM........................................................................ 7

Web Service Configuration .................................................................................................................... 10

Technical Overview ........................................................................................................................... 10

Aurion Service EV397_AURION_WS ............................................................................................. 10

Changes to web.xml Configuration .............................................................................................. 11

SS Session Manager ...................................................................................................................... 13

Testing the Web Services .................................................................................................................. 14

Example .NET WebService Studio .............................................................................................. 14

Example Purpose-Built PHP Application .................................................................................... 19

Aurion API Classes Overview ................................................................................................................. 25

API Classes ......................................................................................................................................... 27

LOGON .......................................................................................................................................... 27

SETFUNCTION ............................................................................................................................... 27

SETVALUE ...................................................................................................................................... 28

CALLFUNCTION ............................................................................................................................. 29

LOGOUT ........................................................................................................................................ 29

CALLFUNCTION2 ........................................................................................................................... 29

CALLFUNCTION3 ........................................................................................................................... 30

API Functions ......................................................................................................................................... 31

Viewing API Field Details ....................................................................................................................... 38

Setting a Field to Null ............................................................................................................................ 38

API Notes ............................................................................................................................................... 40

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence

Query to XML API .................................................................................................................................. 44

Example 1 of Parameterised Query + Output to XML ...................................................................... 44

Example 2 of Parameterised Query + Output to XML ...................................................................... 46

Returning the results in CSV format embedded in XML ................................................................... 52

Run the API to use the Query in Example 2 ...................................................................................... 53

Determine the parameter tags ..................................................................................................... 53

Summarise the API inputs............................................................................................................. 55

Run the API using SETFUNCTION, SETVALUE and CALLFUNCTION ............................................... 55

Run the API using CALLFUNCTION2 .............................................................................................. 61

Run the API using CALLFUNCTION3 .............................................................................................. 62

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence 1

Introduction

Aurion has created a number of Application Program Interfaces (API's) that expose functionality

within Aurion to developers and end-users of other software products.

Whilst the Aurion database may be accessed and modified directly via ODBC or other methods,

Aurion does not support these methods. Aurion API's are written specifically to allow access to

functionality and data within Aurion in a controlled manner. These APIs enforce the business

rules defined within Aurion and by doing this, safeguard referential integrity that might otherwise

be compromised by unsupported access.

Aurion APIs may be accessed via COM using other development tools such as Microsoft Visual

Basic, VBScript, Borlands Delphi etc.

The Aurion APIs are also available via an Aurion Web Service. This gives 3rd party applications

that are Web Service aware, the ability to access the Aurion API functions from external locations,

rather than relying on a local installation of the Aurion API components.

COM Configuration

Aurion has developed an interface to allow for API access from software products capable of

taking advantage of functionality exposed via Dynamic Link Libraries (.dll's). i.e. COM interface.

Technical Overview

Aurion API functionality is exposed via the aurion10.dll DLL. Once this DLL is registered, its classes

and functions are available via the Object Browser in Visual Basic and to all COM compliant

development environments.

Uniface generated DLLs use the concept of a configuration definition. This is a single name that

represents the combination of asn file, ini file, aps file, command line options, working directory

and Uniface bin directory.

The configuration definition for the aurion10.dll DLL is aurion10.

Configuration definitions are stored under the Compuware/UNIFACE area of the registry and can

be maintained by the Configuration Definition Management program (uComCfg.exe).

The API Classes and Functions exposed by the aurion10.dll DLL are detailed later in this document.

As the aurion10.dll can only have a single configuration definition, therefore, it can only be

configured to a single Aurion environment. An aurion10_test.dll and aurion10_tng.dll have also

been created. The configuration definition for the aurion10_test.dll is aurion10_test and the

configuration definition for the aurion10_tng.dll is aurion10_tng.

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence 2

If you have developed a program that calls Aurion APIs via an Aurion DLL that was issued in a

version previous to 10.4 MR2, then this program will need to be recompiled with the 10.4 MR2

version of the aurion10.dll.

Currently APIs can only be called by the COM interface if the program calling the APIs is a 32bit

application.

Installing aurion10.dll

For COM clients, such as Visual Basic and VbScript, to locate and load an object, you need to

register the objects class in the Microsoft Windows Registry for each PC accessing aurion10.dll.

1. Register the aurion10.dll. Run regsvr32 as follows:

32 bit operating system

Regsvr32 \aurion10.dll

64 bit operating system

%WINDIR%\SysWOW64\Regsvr32 \aurion10.dll

The aurion10.dll file is typically located under the Aurion environments API\COM directory on the

application server. If you are registering the aurion10.dll on a PC/server where Aurion is not

installed, copy the contents of the COM directory to this PC/server. The mfc80.dll is also required

for the Aurion 10 COM interface to work.

E.g. If you would like the aurion10.dll to be located in the C:\AurionAPI directory then copy it from

the Aurion environments API\COM directory along with the mfc80.dll. Then run the following to

register it.

32 bit operating system

Regsvr32 C:\AurionAPI\aurion10.dll

64 bit operating system

%WINDIR%\SysWOW64\Regsvr32 C:\AurionAPI\aurion10.dll

2. Use the uComCfg.exe (32 bit application) tool to edit the Aurion Configuration Definition

entries in the Registry. This tool is distributed with UNIFACE and can be found in the Aurion

environments Uniface\Common\bin directory.

3. This step must also be completed for every PC accessing Aurion functionality via the DLL,

however once the first Configuration Definition entry is entered on a PC, a .reg file may be

created to expedite distribution to other PCs using the registry editor.

NB. For ease of deployment it is recommended to run the uComCfg program as a local

administrator so that it updates the HKEY_LOCAL_MACHINE section of the registry. Storing the

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence 3

configuration settings in HKEY_LOCAL_MACHINE means that the uComcCfg program will not have

to be run for every user that wishes to call APIs via the DLL on that PC / server.

The following screen shows the Configuration Definition Management dialog with explanations.

Field Description

Configuration Definitions This should be aurion10, aurion10_test or

aurion10_train

UNIFACE Initialization File

This needs to point to the usys.ini. This can be a

UNC path if the usys.ini contains settings with

UNC paths rather than local or mapped drives.

UNIFACE Assignment File

This needs to point to the aurion.asn file. This

can be a UNC path if the aurion.asn contains

settings with UNC paths rather than local or

mapped drives. If the aurion.asn file is

configured as connecting directly to the database

(i.e. not using the URouter) then you will need to

create an asn file that specifies the physical path

to the license.xml rather than the license

manager (e.g. 7188@server). This is due to the

API interface using server license features rather

than client ones. Server license features are

always read directly from the license.xml.

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence 4

Field Description

Uniface Installation Directory This needs to point to the Uniface bin directory

(Uniface\Common\Bin).

UNIFACE Working Directory This needs to point to the Uniface bin directory

(Uniface\Common\Bin).

Keep COM component in

memory

Check this box if a process repeatedly calls

Uniface COM objects. This speeds up COM

operation and prevents memory leakage, which

is particularly useful when Uniface services are

being called from ASPs.

NB. If your Aurion.asn is configured to directly connect to the database (i.e. the $AURION line in

the paths section does not use the TCP driver but rather a Uniface database driver such as MSS,

ORA, DB2 or SOL), then you will need to configure the $LICENSE_OPTIONS line in the Aurion.asn to

point to the physical license file, rather than connect to the Uniface license manager. Below is an

example of an asn file that includes the Aurion.asn and then sets the $LICENSE_OPTION setting to

the physical path to the license file.

#file

[SETTINGS]

$LICENSE_OPTIONS LM_LICENSE_FILE=

E.g.:

#file D:\Aurion\Aurion10\Aurprod\ADM\aurion.asn [SETTINGS] $LICENSE_OPTIONS LM_LICENSE_FILE=D:\Aurion\Aurion10\Common\DLM\License\license.xml

The settings entered in the UComCfg program results in the following registry entries.

32 bit operating system

64 bit operating system

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence 5

You can export the aurion10 branch of this registry key for deployment to other PCs of the same

operating system (i.e. either 32 or 64 bit).

Aurion Corporation Pty Ltd 2016 V 1.1 Last Updated: 19/09/2016 Commercial in Confidence 6

Running the COM Interface Test Program

Test the aurion10.dll has been registered and configured correctly by launching the

AurionAPITest-COM.vbs program on the computer. This VBScript can be copied from the Aurion

environments API\COM directory on the application server.

If the computer is running a 64 bit windows operating system, then you will need to open a 32 bit

DOS window (i.e. %WINDIR%\SysWOW64\cmd) and then navigate to the directory that contains

the AurionAPITest-COM.vbs and run either AurionAPITest-COM.vbs or wscript AurionAPITest-

COM.vbs.

When the AurionAPITest-COM.vbs is run the following screen will appear.

Login Test

To test the API Class LOGON, select the Function LOGON, enter a User ID into Input 1 and a

password into Input...

Recommended

View more >