November 4, 2019 Andrew

Add Power and Flexibility to your Omnis Apps with Web Services and APIs

A very important ability of Omnis Studio that adds to its power and flexibility is that you can integrate data and functionality from other applications by using Web Services. The data and functionality of such external or third-party applications is exposed via a web-based Application Programming Interface (API) which you can interact with in Omnis Studio via a Web Service.

Omnis Studio provides RESTful support for accessing third-party applications via a Web Service client. REST is the predominant architectural style being used today to consume and publish Web Services. A RESTful Web Service is identified by a URI, and a client interacts with the resource via HTTP requests and responses using a fixed set of HTTP methods, returning textual data in JSON format. In Omnis Studio you can create an HTTP client by instantiating a new Web Worker Object, which will have properties and methods based on the type of web service you are using. You must create the client interface to the Web Service Object which can be a JavaScript remote form for web or mobile apps, or a window class for desktop apps.

In addition, the Web Service support in Omnis does allow the Omnis App Server to expose your Omnis code as a RESTful Web Service. For example, in a multi library environment you could expose functionality from one library as a Web Service, and consume that service by another library.

Omnis Weather Demo App

To demonstrate the capabilities of Omnis Studio to consume a Web Service we have created an example application that accesses basic Weather forecast information, and presents it in a Web or mobile application using the JavaScript Client. The example is based on the free API service provided by openweathermap.org , a company providing a wealth of location based data from around the world including weather data, satellite imagery and other environmental data.

Online Demo

The Omnis Weather Demo app is available to view online on your desktop, tablet or mobile in the Omnis JavaScript Apps Gallery:
www.omnis.net/platform/#jsgallery

or you can go directly to the demo using the shortcut:
tinyurl.com/jsweather10

Omnis Weather demo app

Download and More info

The Omnis Weather app is examined in more detail in a Tech Note: TNWS0002 which is available on the Omnis website. From there you can also download the library, either as a ZIP archive or from our GitHub repo.

Further information about creating a Web service client, or your own Web Service API, is provided in the Omnis docs in Chapter 1 ‘Web Services‘ of the Extending Omnis manual.

, , , , ,