Main Board > Web Services

Setup EZWeb server on RedHat Linux 8.x Server

(1/3) > >>

nmartinez@bristolind.com:
Hi all,
This is our first time setting up an EZWeb server on a RedHat Linux 8.x server.  We are testing the unsecure connection with port 8080 and when we try to access it via http://192.168.77.201:8080, we get the error shown on the attached file.  We probably still need to do some additional configuration.  Does anyone know what additional steps we are missing?
Our goal for getting setting up this EZWeb server is to be able to integrated one application on our current custom ERP (written in PVXPLUS) to TULIP via (BI-DIRECTIONAL) API calls.
Thank you!



Mike King:
Assumin you have install PxPlus 2022 (v19), please try changing line 92 in *plus/inomads/inomads as follows:

->load "*plus/inomads/inomads"
->list 92
0092 IF reqd_uid$="" THEN RETURN
->92[THEN]=[then UID_SET=1;]
0092 IF reqd_uid$="" THEN LET uid_set=1; RETURN
->save

nmartinez@bristolind.com:
Thank you, Mike!
It now takes me to the iNomads System Administration Functions. 

Is there a technical document that covers each one of these (iNomads system Administration Functions)? 
System Settings -> (TX Maint, Config, Custom)
Template Settings -> (Options, Custom, View/Edit files, Test)

Mike King:
A lot here depends on what you trying to accomplish.  By default the web server will take you to an iNomads configuration page, however from what you described you don't need to use iNomads.

If all you are looking for is to create a web site that will respond to some programmed enquires, then you don't need to use iNomads.

To keep this simple what you can do is create a program with a .pxp suffix and the system will run it in response to a web request.  For example if you want to provide a process that responds to a web request with some part information you might make a program called "parts.pxp".  It can take the part number passed in from the URL and return the part description, Qty on hand, and price.  It would look something like this:

  OPEN (HFN,ERR=Failed) "path_to_part_file"
  READ (LFO,KEY=PartNo$,DOM=Failed) PartNo$,Description$,QtyOnHand,Price
  PRINT (%Print_fn) "AOK"
  PRINT (%Print_fn) Description$
  PRINT (%Print_fn) QtyOnHand
  PRINT (%Print_fn) Price
  END
Failed:
  PRINT (%Print_fn) "Failure:", MSG(err)
  END

Now save that in the program as (parts.pxp) in the directory you are running your web server in.  If using EZWEB and you didn't specify a starting directory in the command line this will be the directory *plus/inomads.  We would suggest you change this by launching EZWeb passing the directory on the command line as follows:

  .../pxplus "*ezweb/server" -arg portNo "" starting_directory

So if you save parts.pxp in /home/myapp/website/parts.pxp your command to launch *EZweb might be:

  .../pxplus "*ezweb/server" -arg 8080 "" /home/myapp/website

Now once you have the server up you should be able to point a browser to:

http://192.168.77.201:8080/parts.pxp?partno=XXXXXXX

Where the server (192.168.77.201) is from the screen shot and details you posted and the XXXXXX is the partno$ value you want your program to receive. 

In response to this request you should have a screen that says "AOK" followed by the part information or "Failure" and the reason.

Now if you want to return the data as JSON (common for intra-application data exchanges) you could put the values you want to pass back into an associative array and use the DIM LIST directive to generate the JSON.  You would then output that to %PRINT_FN and change %CONTENT_TYPE$ to "application/json".

This gives you the basics of using the PxPlus Web server and should get you going.

nmartinez@bristolind.com:
You are awesome!!  Thank you Mike! :)

Navigation

[0] Message Index

[#] Next page

Go to full version