Skip to content

onlysumitg/qhttp_setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QHTTP

Its still in active development so there might be bugs. But this version is fully functional. Please feel free to report the bugs at onlysumitg@gmail.com

About QHTTP

QHTTP simply allow you to expose any DB2 for I stored procedure as a Restful service. It should take less then 5 minutes to setup and should not take more then couple of minutes to expose the stored procedure as service. Its specifically designed not to include any business logic. So, all the business logic should stay on IBM i.

Requirements

  • **Dont need to install the QHTTP jar file on IBM I.
  • IBM I® of course.
  • Java 8+.
  • QHTTP uses Eclipse Jetty as the server.
    • So it can be installed on any server (including IBM I) /pc that has java ® installed.
    • Never got a change to install and test on IBM I.

Features

  • Simple setup and interface.
  • Dont need any special code inside the DB2 for I stored procedure.
  • It does not require any web server (like Apache) on IBM i.
  • It can be used with any existing DB2 for I stored procedure.
  • It uses JWT bearer token for auth.(please check system.properties for JWT config)
  • It can be installed on NON IBM i systems(But not required). You can install it on your pc also.
  • It can connect to mutiple IBM i systems.
  • Auto log all request and response data.
  • Auto convert stored procedure output to JSON.
  • Integrated with Open API.
  • Auto create Open API documentation at following levels
    • Admin
    • Server
    • Service
    • Group
    • User

Next Step

  • Expose SQL queries as services.

Installation

  • Download and unzip the zip file
  • Click on QHTTP.JAR OR
  • user this command from command line: java -jar QHTTP.JAR

Setup

Setup need 4 steps:

  1. Add an IBM I server.
  2. Configure a SP as webservice.
  3. Create a web services group.
  4. Assign the web services group to a user.

Setup Example

This is a sample SP with IN/INOUT and OUT parameters and 2 resultsets.

SP

Login

Login

  • User Name: Admin
  • Password: AdminPass

1. Add a server

AddServer

Server

  • Add required details for server.
  • Setup job libl if required.

Sercer

  • Server setup is done
  • Long press on server item to check the server usages.

2. Add a new service

Login

Login

  • Enter required details
  • Click Test & Save
  • It will load the stored procedure details from the server.

Login

  • After saving "Open Api specs" button will be enabled

Login

  • Enter test values for IN and INOUT paramters
  • click "view IN/OUT" to check a sample.

Login

3. Create a new service group.

Login

Login

  • add webservice to the group.

4. Create a new user.

Login

Login

  • Give user access to the group. (One user can have multiple groups).

Login

  • Click save to generate a user token
  • Click on token to copy.

Testing time with Swagger UI.

Login

Login

Login

Testing time with Postman

Login

Log entries.

Login

Login

H2 Embedded Database

SSL

system.properties

  • for system level configurations Like JWT key and SSL.

openapi.properties

  • configuration related to OPEN API.

Predefined IN/INOUT parameters.

  • You can define IN or INOUT parameter with following names to receive the request data
    • http_request_method
    • http_request_url
    • http_request_endpoint
    • http_request_ip
    • http_request_port
    • http_request_protocol
    • http_request_username
    • http_request_useragent

About

QHTTP: Expose DB2 for I stored procedures as Restful services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published