Natural subprograms can be exposed as (Web) Services through , a DataView (XRD) maps the parameters passed to the called subprogram.
The following steps are required:
Define a driver and prepare the environment, described in separate sections for Mainframe, Unix / Linux and Windows platforms.
For prerequisites and compatibility information please read here
The preferred way for creating DataView(s), the mapping from a Natural Paramaeter Data Area (PDA) to the Portus structures exposing the Service via a WSDL, is through an automatic "discovery" process as described here
Add a new Portus Service, specifying the following:
For "Service Identification and Options":
In addition to the manual approach described in detail in the Data Views section, Services and DataView(s) for Portus can be generated/imported from SYSOBJH extracts or directly from Natural sources.
For a detailed description of the process refer to the Service Creation section
Using Portus in an environment protected by Natural Security (NSC)
Defining the driver
In the Portus View, select the server you want to define a Natural driver for, right-click and select the "Add Driver" context function.
From the Driver Configuration Dialog select "Natural_Driver"
The following values are preset, change as required:
Only the Driver DLL parameter is to be entered as is, you are free to choose any Driver Name you wish, set the SBCS codepage and MBCS codepage parameters according to your local or internationalization requirements.
Click the Save button, you will now be asked to (optionally) enter Natural initialization parameters, for example PARM=MYPARM to use a Natural parameter module other than NATPARM.
Click the Save button again, the newly defined driver will appear in the Driver Properties section.
When "Show (post-setup) Driver Information" has been selected, the following information box will be shown, and allow the extraction of the SYSOBJH file containing the Portus Natural interface- and example programs.
Loading the Portus Natural system- and demo programs on Linux / UNIX
The following steps are required to load the Portus Service creation and demo programs in a Linux / Unix environment
For the specific Natural Parameter file to be used when accessing Natural from Portus (default: “NATPARM”), select "Edit" -> “Natural Execution Configuration”
Select “Steplibs”
Define library “SYSEXT” as a “Steplib Extension”
Press the “return” key to save the Steplib modification(s), then use the “Esc” key to close all windows.
Select “File” -> “Save” to preserve the adjusted Steplib setting
Before entering Natural to load the Portus system- and demo-programs the environment variable WRKF3 needs to be set to allocate work file 3 for the “Natural Object Handler”
Here, as an example, the work file name is defined as “natwork3.sag” in the current working directory.
Start Natural, tab to the “Direct” entry on the main menu, enter “SYSOBJH” to start the Natural Object Handler:
Select the Object Handler “Load” function
Select “Load objects from Natural work file(s)”
Enter the Portus OBJH “Work file” name and select “Portable work file” and “Set additional options”
Either enter a “Report file” name, or deselect the “Write report” option
Hit the “return” key a number of times, the following screen will finally indicate what Object handler operation will be carried out:
Hit the “return” key once again, the Portus Natural system- and demonstration objects will be loaded, the following message indicates the completion of the load operation.
Press the Enter ( = return ) key again, and one more time to quit the load function, followed by the “Esc” key to terminate the Natural Object Handler.
Using the Portus in an environment protected by Natural Security (NSC)
Defining the driver
In the Portus View, select the server you want to define a Natural driver for, right-click and select the "Add Driver" context function.
From the Driver Configuration Dialog select "Natural_Driver"
The following values are preset, change as required:
Only the Driver DLL parameter is to be entered as is, you are free to choose any Driver Name you wish, set the SBCS codepage and MBCS codepage parameters according to your local or internationalization requirements.
Click the Save button, you will now be asked to (optionally) enter Natural initialization parameters, for example PARM=MYPARM to use a Natural parameter module other than NATPARM.
Click the Save button again, the newly defined driver will appear in the Driver Properties section.
When "Show (post-setup) Driver Information" has been selected, the following information box will be shown, and allow the extraction of the SYSOBJH file containing the Portus Natural interface- and example programs.
Loading the Portus Natural system- and demo programs on Windows
The following steps are required to load the Portus Service creation and demo programs in a Windows environment
Start the Natural Configuration utility
For the specific Natural Parameter file to be used when accessing Natural from Portus (default: “NATPARM”), under “Natural Execution Configuration” -> “Steplibs”, add library “SYSEXT” as a “Steplib Extension"
Klick the “Save” button, or select File -> Save
Start Natural Studio, the initial display will be something like this
Import the Portus Natural interface and the demo programs. For this, start the Natural Object Handler – enter the command “SYSOBJH” in Natural Studio's Command line
Select the Load function
Select “Load objects from Natural work file(s)”
Specify (or browse for) the Portus OBJH unload file, check “Portable work file”, select “Use additional options”, click “Next”
click “Next”
Click “Next” to “Load all objects from work file”
Click “Next” again to start the actual load process.
The Portus System- and Demo-programs have been loaded. Click “Next”.
Click “Cancel” to terminate the Object Handler load function
Confirm termination of the Object Handler load function by klicking “Yes”
Dismiss the Object Handler “the Windows way” by clicking the “close” icon in the upper right hand corner.
Defining the driver
In the Portus View, select the server you want to define a Natural driver for, right-click and select the "Add Driver" context function.
From the Driver Configuration Dialog select "Natural_Driver", click the Configure button
The following values are preset, change as required:
As the Natural driver requires a number of additional parameters, the dialog will expand and prompt for more input. Again, fill these parameters as required, you are free to choose any Driver Name you wish, set the SBCS codepage and MBCS codepage parameters according to your local or internationalization requirements. Click Save again.
The parameters are as follows
Parameter | Value |
---|---|
NaturalBatchPgm | The name of the Natural Batch nucleus load module. A standard Batch-Natural is used, no modifications or additions to the Natural nucleus are required. Important: This MUST refer to a Natural batch nucleus with NATOS compiled with LE370=NO.
|
InitParms | Natural initialization parameters. Specify any required parameters overriding the Natural parameter module settings, all Natural profile parameters are allowed here. |
PreInitSessions | The number of sessions in the session pool to be pre-initialized. |
MaxSessions | The overall size of the session pool, this parameter should be set to a value high enough to accomodate the peak number of parallel sessions expected. |
NaturalLibrary | The Natural Library to log on. |
NaturalSteplibs | Specify up to 7 Natural library names, in a comma-separated list, to be set as STEPLIB(s). When the NaturalLibrary parameter is not specified as "SYSSOA", include it in the list of Steplibs if you intend to use the "Service creation" feature to import PDA structures and expose them as Portus Service(s).
Note: When running with Natural Security, the Steplib(s) specified here are ignored, they are set by Natural Security based on the logon library and logon user id.
|
NaturalSecurity | Specify Yes or No, depending on if your environment is protected by Natural Security or not.
Note: A logon will be made to the specified NaturalLibrary, with the specified naturalUserId and naturalPassword. It is essential that library SYSEXT as well as any required application libraries are defined as STEPLIBs to that library in Natural Security
|
naturalUserId | Specify a Natural userid defined to Natural Security |
naturalPassword | Specify the password valid for the user defined on the naturalUserid parameter |
Once saved, the newly defined driver will appear in the Driver Properties section:
When "Show (post-setup) Driver Information" has been selected, the following information box will be shown, and allow the extraction of the INPL oile containing the Portus Natural interface- and example programs.
The Portus server Job / STC
Loading the Portus Natural system- and demo programs on the Mainframe
Any standard Natural INPL job can be used to load the Portus system- and demo-programs from the supplied dataset ASGvrm.INPL, for example (as usual, replace the library names, database parameters etc. to match your environment):
//SMAI061 JOB SAG,MSGLEVEL=1,
// CLASS=O,MSGCLASS=X,REGION=8M
//*JOBPARM LINES=9999
//*
//* LOAD NATURAL PROGRAMS INTO ADABAS SYSTEMFILE
//* INPL Portus 411 SYSTEM FILE
//* FROM FILE ASGvrm.INPL
//*
//NATB0100 EXEC PGM=NAT423BA,
// TIME=1400,COND=(0,LT)
//STEPLIB DD DSN=SAGLIB.SMALOAD,DISP=SHR
// DD DSN=SAGLIB.ADA813.LOAD,DISP=SHR
//*
//CMPRMIN DD *
STACK=INPL
IM=D,INTENS=1,XML=OFF,CFICU=OFF
NAFSIZE=0,DLISIZE=0,DB2SIZE=0,MADIO=0,MAXCL=0,MT=0
AUTO=ON
FUSER=(,8)
//*
//DDPRINT DD SYSOUT=*
//DDDRUCK DD SYSOUT=*
//MPMDUMP DD DUMMY
//SYSUDUMP DD DUMMY
//DDKARTE DD DUMMY
//DDCARD DD *
ADARUN DB=001,DE=3390,SVC=249,MODE=MULTI
//CMPRINT DD SYSOUT=*
//CMWKF01 DD DSN=ASGvrm.INPL,DISP=OLD
B
FIN
/*
//
These bits of mapping information are assembled into a WSDL in real time by the Portus server when a WSDL is requested through the following URI for a specific service
http://<server>:<port>/<Service>?WSDL
When the signature (parameters) of a subprogram change, only the DataView needs to be recreated (via "discovery") and the Service "refreshed" (the DataView cleared out of the cache), with the next access to the WSDL it will automatically reflect the changed parameters.
NATURAL to WSDL XML Schema Data Type mapping
Natural Type | DataView | WSDL / XML Schema | Notes |
---|---|---|---|
A | sbcs (space padded) | xs:string | Dynamic variables allowed |
W | mbcs (space padded) | xs:string | |
B | hex.Binary | xs:hexBinary | Dynamic variables allowed |
F4 | float | xs:float | |
F8 | double | xs:double | |
I1 | byte | xs:byte | |
I2 | short | xs:short | |
I4 | int | xs:int | |
L | Natural logical | xs:boolean | 0, false / 1, true |
N | zoned decimal | xs:decimal | |
P | packed decimal | xs:decimal | |
D | date | xs:date | YYYY-MM-DD |
T | date + time | xs:dateTime | YYYY-MM-DDTHH:MM:SS(.s) |
![]() ![]() |
![]() |
![]() ![]() |