The XML files define an operation running in a context that contains a WOSA Device Service. As soon as the toolkit is successfully initialized, an operation is instantiated, the WOSA device is opened, and both the view and the operation are registered as handlers of the WOSA device events. When you click the Print button, the execute() method of the operation is called, and the operation prints the data.
For the sake of simplicity, the demo program uses a single operation that opens, prints, and closes the device. However, since opening a financial device can take several seconds (to check the hardware and load some drivers), this should not be done every time there is some data to print. It is better to open the device, for instance, in a startup operation that sends the terminal and the user ID to the server. Also, the demo program does not lock and unlock the device, since the assumption is that the demo will be the only program that has access to the device at a given moment.
The service will typically be used in the following sequence of calls: