1. General information


1.1. XML interface provides you the most convinient way of getting RK7 system information and saving data to RK7 databases as well as performing operations.

1.2. There are 3 application types in RK7 core that have interfaces: on cash station, cash server and report (reference) server

1.2.1. each supports different set of commands.

1.3. You may create your own templates by template models, that have XML in their names.

1.4. Call functions through RK7XML.dll, interface module RK7XMLi.pas (see 5.2.).

1.5. As for midserv.exe, it uses iTCPXML.dll as driver.

1.6. The modern HTTPs interface available in 7.5.5.0+


2. Manager station settings


2.1. For cash server (simple XML interface)

2.1.1. Add interface driver to cash server (as for cash server: “XML Interface For Windows” (or DOS) driver).


2.1.2. Check this driver to be set to logic interface (see 4.1.2. http://support.ucs.ru/en/node/5670).

2.1.3. Set drive properties: port

2.2. For reference or report server (simple)

2.2.1. Set xml-interface section in report server properties.

2.2.1.1. Port is obligatory, mut be unique TCP in that OS

2.3. For cash station (simple)

2.3.1. Add interface driver to cash station (“XML Interface For Windows” name iTCPXML.dll)

2.3.2. Set driver parameters: Port, CryptKey (option)

2.4. For reference server (HTTP)

2.4.1. Set in server properties HTTP Data Port (unique TCP HTTPs port to be listened).


3. Stations and servers use


3.1. Check

3.1.1. Open application GUI or web interface and find "interfaces" tab.

3.1.2. Check that interface running.

3.2. Use

3.2.1. For simple interface - use client application or test tool as in 4.

3.2.2. For HTTP interface

3.2.2.1. use client application or

3.2.2.2. use web browser and navigate to

https://ip:port/webgui/iservxmltest.htm

https://ip:port/rk7api/v1

https://ip:port/rk7api/v0

3.2.2.3. Use WGET like this:

wget.exe --secure-protocol=TLSv1 --no-check-certificate --header="Content-Type: text/xml" --http-user=9006 --http-password=9006 --post-file=requestData.xml https://127.0.0.1:20001/rk7api/v0/xmlinterface.xml

 


4. External requests tests


4.1. XMLtest

4.1.1. Use XMLtest.exe application to send and receive.
4.1.2. Download this application from UCS file server (ftp://ftpint.ucs.ru/dealers/rk7/ForDealers/XMLInterface/).
4.1.3. Request format to check the whole schema (msxml.msi should be installed in OS):

XMLTest <addr>[:<port>] <XMLRequest> [<XMLResult>] [/PASS:XXXXXX] [/CONN:YYYYYY] [/SCHEME:SchemeFileName].

4.1.3.1. The command line parameters can be used like this

xmltest.exe 127.0.0.1:1122 xmlquery.xml response.xml /pass:password

4.1.4. Mind licence for SaveOrder.

4.2. Interface logs

4.2.1. Do xml interface logging. For that go to RK7 manager station: service -> stations and devices -> All -> [your restaurant] -> [your cash server] (or cash station); on drivers tab choose xml interface Options section OutputDir properly. Set options -> "outputdir" property (enter legacy pathway to save xml interface incoming and outgoing files). Mind that cash server (station) restart required to start logging after making settings.

4.2.2. Start external application (client), operate until the desirable result or error occured, stop all these applications afterwards. The best way is to delete all .xml files from the log folder immediately before an error occured, so that you will have only a very error moment log files.
4.2.3. Compare .xml files from log folder with correct ones or analyze data inside. Find all error records related to the problem you've got in these files and guess how to solve it (if you can't guess, ask UCS tech support than).


5. Querries and functions


5.1. Query list

5.1.0. Each application type has different list of supported XML-queries.

5.1.0.1. List of supported queries might be different for same application type of different versions.

5.1.1. Available queries for (cash server =CS ,cash station =ST, reference server =RS) XML-interface (table).

# CMD Available on Description
1 GetWaiterMessages CS, ST  
2 WaiterMessage CS  
3 GetOrderList CS  
4 CreateOrder CS  
5 GetOrderMenu CS  
6 GetWaiterList CS  
7 GetRefData CS, ST, RS  
8 LoginOnStation CS  
9 PayOrder CS  
10 PrintBill CS  
11 SaveOrder CS  
12 DelWaiterMessages CS  
13 GetItemBlob CS  
14 GetDocByLayout CS  
15 DeleteReceipt CS  
16 GetFunctions CS, ST, RS  
17 SetRefData RS  
18 ImportRefs RS  
19 PutFile RS  

5.1.2. You can get full list of supported by given interface querries sending universal CMD=GetFunctions.

5.1.3. Query schemes (structure and all possible arguments of each query) may be found ftp://ftpint.ucs.ru/rk7/ForDealers/XMLInterface/XML-Schemes/ .

5.1.4. XML-query can be classified :

5.1.4.1. Read data from RK7 database (references, accumulative)

5.1.4.2. Save data to RK7 database (update, insert, delete) - accumulative

5.1.4.3. Change data in RK7 database (update, insert, delete) - references

5.1.5. by default, XML-query "SetRefData" gives you ability to make change in any reference in RK7 DB , similar to "GetRefData" gives you ability to read from any reference in RK7 DB, but there are exclusions about included objects (blobs)


5.2. Functions

5.2.1. Main Function is CallRK7XMLRPC, its parameters:
AddressName - address:port
Request - XML query
RequestSize - the size of XML query
ResultFile - the name of file, where the results will be put
ErrorBuf - where connection error and such things can be written  
ErrorBufSize - the size of ErrorBuf
5.2.2. Function CallRK7XMLRPCToStream -  is the same, but the result is written in IStream, Parameters:
AddressName - address:port
Request - XML query
RequestSize - the size of XML query
ResultStream - IStream - the stream, where the result can be put
ErrorBuf - where connection error and such things can be written
ErrorBufSize - the size of ErrorBuf
5.2.3. Function SetUseTempFileLimit - set limit, when the result is bigger (temporary file will be created). Default = 1000000 ms.
5.2.4. Function GetDLLVersion - receive DLL version
5.2.5. Function SetCryptKey - set key for encoding (can be different for different cash station servers, is set in the parameter of XML interface)


6. Query and response examples


6.1. Get file from reference

6.1.1.To get some file (in base64 format) stored inside references DB, but not exported to external DB, you may use "GetItemBlob" query.

<?xml version="1.0" encoding="utf-8"?><RK7Query><RK7CMD CMD="GetItemBlob" RefName="OLAPReports" RefItemIdent="1001" RefBlobName="LAYOUT" UnpackedBlob="0"/></RK7Query>

6.1.2. The example above will return layout for report id=1001 (filename.fr3).