Beginning with version 11, Advantage ships the Web Platform, a web service that allows applications to communicate with Advantage Databases without having a specific Advantage Client Engine (ACE) available. The ACE is only available for Windows and Linux. Using the Web Platform, any device with any operating system that supports http(s) communication is enabled to access Advantage data, including Android, iOS, and Windows Phone. The Advantage Web Platform is a module for an Apache web server (currently only supported on Windows, Linux might be supported soon) that follows the OData standard (http://www.odata.org).

Installation

To install the Advantage Web Platform, execute adsweb.exe contained in the ADS installation files. The installation process runs quite easy, without having any options to choose.

Web Platform Install Wizard
Web Platform Install Wizard

After the installation is finished, the Apache icon appears in the taskbar. Via the context menu of this icon, the Web Platform can be started and stopped.

Apache Icon
Apache Icon

Testing


By default, the Web Platform is configured to listen to port 6272. You can change it by modifying httpd.conf located in „Program Files (x86)\Advantage 12.0\adsweb\Apache24\conf“. That folder contains another conf file, adsweb.conf, which is used to configure OData end points. But first try out if Apache is running. Open a Web Browser (Google Chrome is recommended due to it’s great debug options) and type

http://localhost:6272

into the address line. Hit enter to open the test page.

Web Platform: first Test
Web Platform: first Test

As a next step, open adsweb.conf and search for the DBConnectionString configuration of example_db. This contains a path to a sample database (Program Files (x86)\Advantage 12.0\adsweb\example_db\tasks.add). Add this to your Data Architect repository for testing.

Data Architect: Database Setup
Data Architect: Database Setup

Then connect the database and open table by table. This will force a reindex, so the collation fits to your local settings. Once done, type

http://localhost:6272/adsweb/example_db

into the address line of your Web Browser. If all works well, you’ll be prompted for database username and password and then this should return an XML script containing the OData end point description.

OData end point description
OData end point description

As a next step, get the content of the Tasks table by using the URI (unique resource identifier)

http://localhost:6272/adsweb/example_db/v1/Tasks

For details on the Advantage-specific URI format see the Advantage help file, chapter „Advantage Web Platform“. The basic URI is

<PROTOCOL>://<WEBSERVER>:<PORT>/adsweb/<LOCATION>/<API_VERSION>/<COLLECTION>

Currently the only supported API_VERISON is „v1“. By default, an HTTP GET operation to that URI returns an XML script. But you can also return the result set in JSON format (Javascript Object Notation), which is easier to read and browse than XML. For that, add the format as a parameter to the URI:

http://localhost:6272/adsweb/example_db/v1/Tasks?$format=json
Task table in json format
Task table in json format

There’s a plugin for Google Chrome available which formats the returned JSON string to a better readable format. This plugin, named JSONView, can be installed from the chrome extensions. Using that plugin, the resulting screen looks like this:

JSONView
JSONView

Conclusion


Advantage Web Platform is a great platform to enhance the reach of your database to operating systems that are not supported by the Advantage Client Engine. Using that Apache module enables you to write Advantage data driven applications for Android, iOS, and other mobile devices.

Advantage Web Platform
Markiert in:                

Ein Gedanke zu „Advantage Web Platform

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.