This tutorial presents how to develop server-side code (adapters) that is used for integrating between the client application, through the MobileFirst Platform, with enterprise back-end applications and cloud services.
The tutorial is followed by explanations and examples for HTTP, SQL, Cast Iron, and JMS adapters. It also shows how to invoke adapter procedures from hybrid and native applications, advanced adapter usage, and how to use Java in adapters.
- Adapters support multiple integration technologies and back-end information systems.
Read-only and transactional capabilities
- Adapters support read-only and transactional access modes to back-end systems.
- Adapters use flexible authentication facilities to create connections with back-end systems.
- Adapters offer control over the identity of the connected user.
- Data that is retrieved from back-end applications is exposed in a uniform manner, regardless of the adapter type.
Each adapter consists of:
- An XML file, which describes the connectivity options and lists the procedures that are exposed to the application or other adapters.
- Zero, one or more XSL files, which contain a transformation scheme for retrieved raw XML data.
Data that is retrieved by an adapter can be returned raw or preprocessed by the adapter itself. In either case, it is presented to the application as a JSON object.
Adapter procedures anatomy
Procedures provide adapter functions to the application.
Procedures call back-end services to retrieve data or to perform actions.
More filtering can be applied to retrieved data with simple XSLT.
- In Eclipse, click the MobileFirst icon that is located in the toolbar and select MobileFirst Adapter.
- Select a MobileFirst project and an adapter type.
- Select an adapter type and type an adapter name. Applications use this name to access the adapter.
- Click Finish.
- Select an adapter to deploy.
- Right-click the adapter and select Run As > Deploy MobileFirst Adapter.
MobileFirst Studio archives the adapter code and deploys it to the MobileFirst Server instance.
You can see the deployed adapter in the MobileFirst Console.
Testing adapter procedures
MobileFirst Studio can be used to test the adapter procedures.
To run a procedure test:
- Select Run As > Invoke MobileFirst Procedure.
- Select the procedure that you want to test.
- Enter comma-separated procedure parameters and click Run.
Adapter XML structure
name: Mandatory. The name of the adapter.
displayName: Optional. The name that is displayed in MobileFirst Console
description: Optional. Additional information that is displayed in the MobileFirst Console
- Defines the connection properties and load constraints of the back-end system.
- When the back-end system requires user authentication, defines how user credentials are obtained.
procedure: Declares a service for accessing a back-end application. One entry for each adapter procedure.