Invoking services and standard APIs programmatically

You can review the sample code for invoking services and standard APIs programatically and review the protocols.

Application provides sample code that demonstrates how the standard APIs and services of the application can be invoked programmatically. See the sample files in the <runtime_sandbox>/xapidocs/code_examples/ directory.

Note: Use the executeFlow() method of the YIFApi interface to run a service defined within the Service Definition Framework.

API and service transactions that are outbound from the application can be configured through the Service Builder, as described in the Organization and participant modeling concepts.

API and service transactions that are inbound to the application can be invoked through the following protocols:
  • EJB
  • HTTP and HTTPS
  • LOCAL
  • Web Services
  • COM+

EJB

Use EJB for server-side execution of the code. Java™ call. All the methods in the application take a YFSEnvironment and a document, and return a document. Since EJBs are designed to be called remotely, each of these documents is serialized on one end and unserialized on the other. However, the application uses an EJB, where each API takes two string parameters and returns a string. Thereby, forcing any document implementation to serialize and unserialize using a standard well-defined interface.

For example, a new EJB is created with method signatures like:
String createOrder(String env, String inputXML) throws YFSException, RemoteException;

where env is an XML that should be a valid input to createEnvironment variable. The return value is the output XML.

When calling an API using YIFClientFactory.getInstance().getApi(“EJB”) the call is made using this String-based EJB. With this type of call you can pass a YFSEnvironment and document, and get a document in return. The application code performs the conversion transparently.

Note: The DOM-based EJB is deprecated. Hence, moving forward you need to use the String-based EJB for server-side execution.

HTTP

Use HTTP for server side execution of code. Java call.

LOCAL

Use Local for client side execution of code. COM or Java call.

Web services

Use Web Services for client side execution of code. COM or Java call.

COM+

Use COM for client side execution of VB or C++ code. COM or Java call.

Using COM requires setting up your server and runtime clients.

Note: Exceptions encountered when making synchronous API calls through EJB, COM, or HTTP transport protocols are not queued for reprocessing.