Printing through OECGI4 and oesocketserver#

This document will show you how to create a program to write to ".pdf" as well as spool directly to a networked printer from a web interface into OI via oecgi4.exe and oesocketserver.

Introduction#

This took a while to sort out, however using the online doco and its sample program, I cut the sample code and then with some help from my friends wrote the attached code.

In addition this is the OECGI4 installation guide from Revelation.

Problems Experienced#

In setting up the b/s OECGI4.exe - I was playing with the registry entries for hours. Finally realised that the oecgi4.exe are amongst the Wow64 settings. Once this was sorted the interface worked straight up.

The correct location for oecgi4.exe is '[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RevSoft\OECGI4]' (see below)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RevSoft]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RevSoft\OECGI4]
    "ApplicationName"="MMS"
    "EngineName"=""
    "FileMode"="2"
    "FilePath"=""
    "OILocation"="p:\\oi94"
    "ProcedureName"="NV_HTTP_MCP"
    "ServerPort"="8080"
    "ServerURL"="localhost"
    "ShutdownFlags"="1"
    "StartupFlags"="1"
    "SysDownPage"=""
    "UserName"="MMS"
    "UserPassword"=""
    "AdditionalValues"="HTTP_AUTHORIZATION,HTTP_MEDIA_TYPE,HTTP_ACCEPT_ENCODING,HTTP_ACCEPT_CHARSET,HTTP_ACCEPT_LANGUAGE"

Addendum#

Laptop is 64 bit, OI java is dark-ages 32 bit I have a 64bit sytem, so my 32bit Java is not in the path (because I only need 32 bit for OI)

  • This is the DOS command line startup "run-java.cmd" I use to run up a desktop 'oesocketserver'
C:\Program Files (x86)\Java\jre1.8.0_181\bin\java -jar oesocketserver.jar -d 3

Configuring OEngineServer#

The other important gotcha relating to the fact that my 32bit java is not in the system path, is how to hook it into the OEngineServer path, and that's done through the "Oeserver\Conf\wrapper.conf".

# Java Application
wrapper.java.command=C:\Program Files (x86)\Java\jre1.8.0_181\bin\java 

NT Service 'OEngineServer'#

When you install the service, the logon is setup as "local system"
And, whilst I made no attempt to sort how to make that work, I simply changed the login collateral to my login id at my laptop as per the image below

'OEngineServer' logon

3. Program code#

This is the sample program code

  • the code has more commentary than actual BASIC, so hopefully it's easy to follow
  • look around line 122, and change the talking_to_web = 1 to select which mode you want. You can pass this into the code so it works dynamically.