Use the Worklight: mobile service pattern to integrate a mobile application written for the Worklight platform with a service that is running in WebSphere Message Broker. You can use the pattern to make a Message Broker service available through REST APIs used by mobile applications running on all types of device.
An instance of the Worklight: mobile service pattern is configured with a Message Broker service that must be in your workspace. A Message Broker service defines a service interface that includes the service name, the operations, and the parameters for each operation. A Message Broker service project contains the service interface as a WSDL file. The data types for each operation are contained in an XML schema. The service is implemented in one or more message flows in the service project. When you configure the Worklight: mobile service pattern, you choose the service and also which operations you want to allow mobile applications to use. The pattern generates a Worklight adapter. The adapter implements one procedure for each selected operation. A mobile application can access the procedures using standard Worklight client APIs (REST/JSON). The pattern also adds a message flow to the service. This message flow adds an HTTP/JSON binding to the service project so that the adapter can access the service.
When a mobile application uses the service using WL.Client.invokeProcedure
,
Worklight passes the JSON parameters from the call to the Worklight adapter generated by
this pattern. The adapter accesses the service on Message Broker, passing the parameters
from the mobile application. Output parameters from the service are returned to the
mobile application through the Worklight adapter.
This pattern does not generate Message Broker projects, services or applications. You must design and implement the Message Broker service required by this pattern. This pattern generates an adapter which provides the interface between mobile applications and the Message Broker service. As part of the management of that interface, you can choose which operations to expose to your mobile applications.
The Worklight adapter must be deployed to the Worklight Server to provide the interface between the mobile application and the service running in Message Broker.