Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ho can I call external API and print response in SIM file of Micros POS 3700 2

Status
Not open for further replies.

Ibrahim Wali

Programmer
Aug 14, 2020
6
PK
Hello,

I have done searching google now posting in this forum,

Please help me, How can I call external API using sim file in micros POS 3700.?

Example: I want to call when check closed and want to print the return result on check print.

Help in any form will be greatly appreciated.

Thanks & Regards
 
Hi Ibrahim,
There is no way to do this in ISL. You will either :
1. need to create a c dll and include it in your ISL and call one of the exported methods in it
2. need to create a TCP/GW that acts as proxy between ISL and your API

Hope this helps.
 
Thank you CodexPOSed for response,

Can you also share any example for point 1 and for point 2 you have mentioned.

It will be a great help.
 
Hi Ibrahim,
The first one involves creating a C class and exporting the methods to consume in you ISL script. Assuming that you have a C dll, you can do something like:

Code:
event Final_Tender
	DLLLoad dllHandle, "YourAPIClass.dll"
	DLLCALL dllHandle, CallMyAPI(@CKID, ref returnValue)
	//Do you thing in ISL
	DLLFree dllHandle

endevent

I am not a C programmer, so i dont know how to do create that library. I do use DotNet. And i i think you can export your DotNet clas by dressing it up with DllExport, and fake the ISL script to import it as if it is C class, something like this:
Code:
        [DllExport("CallMyAPI", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
        public static void CallMyAPI(string cjeckNumber,  out string returnValue)
        {
			//Call your API here 
        }


I exclusively use the second method for my projects since it is portable to other Oracle flavors easier and ISL works on all micros terminals regardless of their OS.

On this approach, i have a Windows Service that opens a TCP/IP port as a server and listens for incoming ISL packets. When it receives a packet, it parses it, calls the API and returns the response ISL packet. Windows service is written in DotNet but you can use whatever your choice of language on any other OS. It just needs to open a TCP/IP port as the server side. ISL packet structure is well documented in Oracle documents. you just use TxMsg to send a packet out and RxMsg to receive back an ISL Packet response.

Hope this helps.
 
codexPOSed has said the best options.

Another crude method is to write an exe to perform your task which writes the response to a file on the disk.

You can run the program using the SIM system command and read/write to files using the fopen, freadln and fwriteln SIM commands.

This is handy when working on older systems which are running Windows CE and the DllExport can't be used.

Do you want some custom SIM scripts developed. Contact me via my website
 
Another way is a SERVICE compatible with the PMS message formats that provides your return information and use RX/TX message to obtain your information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top