Skip to content

Installing MDpulse4i Server

Installing Application Server

MDPulse4i server is installed after MDRest4i SDK using the following installation steps.

Download the MDPULSE4I savefile

Download this save file from our servers, and upload this to the IBM i "tmp" IFS folder.

https://www.midrangedynamics.com/downloads/mdpulse4i_14.0.0.savf

Click here for MDPulse4i Save File

Copy from the stream file

Copy the downloaded save file to QTEMP library for installation.

CPYFRMSTMF FROMSTMF('/tmp/mdpulse4i_14.0.0.savf') 
TOMBR('/QSYS.lib/qtemp.lib/icebreak.FILE') MBROPT(*replace) CVTDTA(*none)

Restore the installation image

RSTLIB SAVLIB(blueice) DEV(*savf) SAVF(qtemp/icebreak) RSTLIB(iceinsttmp)

Change the installation command for correct library

CHGCMD iceinsttmp/iceinstall PRDLIB(iceinsttmp)

Run the installer

  1. Choose an instance name for the MDPULSE4i product e.g. MDPUL
  2. Set the server root path - e.g. /mdrest4i/mdpul
  3. Select an appropriate port number for the MDPULSE4i Admin Server - e.g. 7784

Execute the command using the variables selected above

iceinsttmp/iceinstall LIB(mdpul') IFSPATH('/mdrest4i/mdpul') ADMINPORT(7785)

Delete the temporary Installation Library

The temporary installation library created above is of no further use and can be deleted.

DLTLIB iceinsttmp

Add MDPulse4i License Code

Retrieve the required information for issuing a license using commands:

Information required for MDPULSE4i license code
DSPSYSVAL QMODEL 
DSPSYSVAL QPRCFEAT 
DSPSYSVAL QSRLNBR

Email this information to mdrest4i-support@midrangedynamics.com

Please include your first and last name, and the company name the license is for.

Adding a runtime server

You will now add a new server that will be used to execute your APIs

  1. From a command line type in command GO MDPUL/ICEBREAK. MDPUL is the library where the app server was restored to, during the installation above.
  2. Select option 12 - Work with Servers
  3. Press F6 - Create to create a new server

Use the following settings:

Parm Notes
SRVID Any 10 char name
TEXT Suitable Description for this API server
SRVTYTPE *WEB
APPLIB This library is used to set the *CURLIB for the server jobs .
Any library you put here will be the default place where applications are loaded ( can be loaded from anywhere) and compiled to - if the server is set into *DEVELOP mode.
CRTTRC Logs all requests and responses that go through the server
TRACEPATH Full path - including file name ending with ".txt" for the trace log
MODE *PROD = Production mode which is faster and doesn't recompile JIT Applications
*DEVELOP = Development Mode. Allows trace and caches any preloaded procedures when using NOXPRCAPI.
MLTITHREAD Runtime server options:
Prestart shared pool size - how many pre-start jobs to start.
Shared Pool maximum size - a number that will set the maximum it will create when more jobs are required to service requests, before a new "AA" job is created.

Configure the new server for API execution

Update the webconfig.xml and set the library list for this execution context.

  • Navigate to the admin server. use the host name, and port number used when installing the server. e.g http://host:7784/
  • In the left hand menu select Administration>work with servers
  • Right-click on the server created above, and select Edit
  • navigate the Library List tab.
    • Add library name MDRST note: use MDRSTxxxx where xxxx is the isntance name you assigned when installing MDRest4i using MDREST4INS.
    • Add additional libraries according to your requirements.
  • Scroll the tabs to the far right until you can select Webconfig
  • Locate the <routing....> section. Update the routing section to:
<routing strict="false">
    <map pattern="/noxprcapi/" pgm="noxprcapi" lib="*LIBL"/>
    <map pattern="/noxdbapi/" pgm="noxdbapi" lib="*LIBL"/>
    <map pattern="/mdpulseapi/" pgm="mdpulse4ir" lib="*LIBL" casesensitive="false"/>
    <map pattern="/testapi/" pgm="testapi" lib="*LIBL"/>
    <!--    <map pattern="^.*"    pgm="default" lib="*LIBL"/> -->
</routing>
  • Locate the <envvar....> section. Update the routing section to:
<envvar>
    <var name="NOXDBAPI_EXPOSE_SCHEMAS"  value="<yourproclib>>"/>
    <!-- <var name="NOXDBAPI_EXPOSE_ROUTINES" value="ANNOTATED"/>
    <var name="NOXDBAPI_EXPOSE_VIEWS"    value="ANNOTATED"/> -->
    <var name="NOXDBAPI_ROOT_NAME"       value="data"/>
    <var name="MDREST4I_RESOURCE_COMPONENT"  value="2"/>
</envvar>

yourproclib

<yourproclib> is replaced with the library that contains the procedures you wish to expose as REST API's.

  • Select Save
  • Right click on the server again, and select Restart the server

Testing the server

A test program MDRST/MDPHELLO has been created to test that the server is working and configured correctly

  • Copy object MDRST/MDPHELLO into your API library or any library set in the library list tab above
  • In the browser use this url: http://yourhost:yourport/mdpulseapi/mdphello?firstname=david
  • The response should look like this: {"hello":"hello david "}