API behavior

Each API takes an XML document as input and returns another XML document as output. APIs can be asynchronous or synchronous.

The YFSEnvironment input parameter represents a runtime state under which this API is being invoked. It is used for the following tasks:
  • Security audits and logging
  • Transaction control
  • Achieving invocation-specific API behavior

For an asynchronous service, IBM® Sterling Order Management System automatically creates an instance of this object and passes it to each API part of the service. To programmatically invoke a synchronous service, you have to create an instance of this environment by calling the createEnvironment() API.

Note: In general, input to APIs should not contain any "BLANK" elements or attributes. A blank element can be defined as an element containing all the attributes with blank values. If a blank element is passed, the API behavior is unpredictable.

All APIs (whether standard or extended) have the same signature with respect to input parameters and return values. This signature is of the form

org.w3c.dom.Document APIName(YFSEnvironment env, org.w3c.dom.Document input);

In order for custom APIs to access custom values, the API should implement the com.yantra.interop.japi.YIFCustomApi interface. If entered, these name/value pairs are passed to the Custom API as a Properties object. For more information about the com.yantra.interop.japi.YIFCustomApi interface, see the Javadoc.