📜 ⬆️ ⬇️

Familiarity with Rest4Enterprise or REST services for the lazy

It so happened that on duty faced the following task: it was necessary to quickly and as easily as possible generate many REST services . It seemed to me that there should be a lot of solutions, this is not such a difficult task. And what was my surprise when, after fumbling around the endless expanses of the Internet, I found only a couple of suitable products. I chose Rest4Enterprise , restSQL and IBM Web API Services among the most suitable for me (who else knows what? You are welcome!). restSQL seemed to be quite tiny, a product from IBM - on the contrary, the most powerful beast. Therefore, adhering to the rule of the "golden mean", I decided to try Rest4Enterprise. The product is still completely new (January 2013), there is no information on it except for the official source at all, so I decided to share my little experience with it.

What is Rest4Enterprise and what it is eaten with

Rest4Enterprise is an application that allows you to use SQL queries for databases as a REST service. The application consists of two modules: the administrative part, which allows you to quickly create and configure services, and, in fact, the engine itself. The official resource posted a video - a small manual, like, say, use this application, install guide and user guide. It turned out to be not difficult to master the work with him, therefore this information was enough for the beginning.

Preconditions

To run a web application, you need an application server. It is worth noting that only the two most popular servers are supported: JBoss and Tomcat. Choose one of them will be offered at installation. Also make sure you have a JVM installed.

Installation and preparation

To install using a cross-platform jar-installer. During installation, among other things, you will be prompted to register a port for the Infinispan grid platform. Nothing unusual, everything is standard.
image
')
Having completed the installation and running the web application, you need to take some necessary steps before starting to create REST services. Carefully following the user guide and all the same video, after 5 minutes, almost everything was ready. Using the admin part of the interface, you first need to load the driver for the database (using MySQL).
image

And then in a couple of clicks we create a JDBC DataSource.


Immediately, in this window, you can immediately and test the connection.


Resources are identified using a URI, which includes the version, group and name (/ version / group / name), so you need to add a version and a group in separate windows.
Add a version.


Add a group.


Resource creation

Now you can start creating the resource itself. The resource name is entered in the window, version, group, datasource is selected in the drop-down lists (this is all created earlier), the HTTP request method (GET, PUT, POST), and the query itself is also written (query).


It is convenient to immediately check the correctness of the request: enter specific values ​​instead of the request parameters and immediately get the result.


That's all - the minimum set of what needs to be done to create the simplest REST service.
Check the work of the newly created REST service.


Total

In addition to the features that I used, Rest4Enterprise also provides other, more advanced ones: the use of JNDI, custom filters and validators, LDAP servers for authentication.
In general, Rest4Enterprise is quite a good tool, albeit with limited capabilities (for example, you cannot use stored procedures), but it can be quite useful if you need to be “simple and quick”.

Main link

As I mentioned earlier, there is no information other than the official resource on R4E, so the main link below is one:
Rest4Enterprise. Become a “supplier” in the API economy securely and simply.
Here is all that is. It is told what it is, guides and the application itself are available for download.

Source: https://habr.com/ru/post/169871/


All Articles