Table of Contents

Print Service

The COBI.wms Print Service is an MS Windows service which receives commands from the Android app and triggers a print event on the Windows machine.

How it works / Limitations

Currently, the service only works in combination with Coresuite Remote Print.

The service generates XML files and puts them in a folder that is scanned by Coresuite Designer, which takes care of the actual printing. This means, you must have Coresuite Designer installed and configured correctly to pick up XML files from a specific folder.

See here for the relevant Coresuite documentation:

http://helpfiles.coresystems.ch/help/country_package/manual/en/index.html?des_configuration_batchprint.htm

Only the User and Parameter Scan-Path fields need to be filled out.

Also, if you don't have Coresuite Service, then at least one SAP Business One client must be running at all times for Coresuite Designer to process the XML files. See here for information about Coresuite Service:

https://helpdesk.coresystems.ch/hc/en-us/articles/360034896353-Coresuite-Service

(If either of the above links to the Coresuite documentation don't work, please notify support@cobisoft.de so we can update this page.)

XML files that are placed into the folder will be moved automatically into a sub-folder called _executed if the print job was successful, or into a sub-folder called _error if there was a problem. (These folders are created and managed automatically by Coresuite.) In case of an error, you can open the XML file in the _error folder (with Notepad or another text editor) and see if an error message was written into it. Usually, Coresuite writes the error message into these files in the form of an XML comment, near the end of the file.

NOTE: All of the above is done by Coresuite, not by the COBI.wms Print Service. If the XML files are not being processed, check if Coresuite is set up and running correctly. The job of the COBI.wms Print Service is done in the moment where the XML file is generated and put into the configured folder.

Installing the COBI.wms Print Service

First of all, make sure that a recent version of the Microsoft .NET Framework is installed.

Download the program here: cobiwms-print-service.zip

  1. Extract the ZIP into a folder called exactly C:\cobiwms-print-service\.
  2. Open the folder, right-click on cobiwms-print-service.exe and open its Properties.
  3. At the bottom of the Properties window, check “Unblock” and confirm. (If you can't see “Unblock”, skip this step.)
  4. Start cmd.exe or PowerShell as Administrator.
  5. Enter this command: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe C:\cobiwms-print-service\cobiwms-print-service.exe
  6. Create the file C:\cobiwms-print-service\config.json with contents like below.

Note: Currently it is not supported to install the service under any other path than C:\cobiwms-print-service\; please contact support@cobisoft.de if this poses a problem for you.

After the service is installed and the configuration file is created, you can start/stop the service from the MS Windows Services application.

Example config for single-tenant setup (e.g. on-premises or private cloud):

{
  "ListenPort": 9110,
  "TenantConfig": [
    {
      "PrintDirectory": "C:\\CoresuiteRemotePrint\\Productive"
    }
  ]
}

The PrintDirectory must correspond to the Parameter Scan-Path of the Coresuite Designer configuration; see above.

Example config for multi-tenant setup (e.g. public cloud):

{
  "ListenPort": 9110,
  "TenantConfig": [
    {
      "AuthToken": "SECRET_1",
      "PrintDirectory": "C:\\CoresuiteRemotePrint\\Tenant_1\\Productive"
    },
    {
      "AuthToken": "SECRET_2",
      "PrintDirectory": "C:\\CoresuiteRemotePrint\\Tenant_2\\Productive"
    }
  ]
}

In a multi-tenant environment, the correct AuthToken must be entered in the COBI.wms Print Settings screen for the app to be able to trigger print jobs. The token serves both to identify the tenant, and as a password to ensure that tenants running on the same cloud environment cannot accidentally or intentionally trigger print jobs for each other.

NOTE: The COBI.wms Print Service does not support encrypted communication. This means that if you make the TCP port of the Print Service open to the Internet, and set up COBI.wms to contact it, then the tokens will be sent unencrypted over the Internet! It is strongly advised to set up a VPN connection in this scenario to ensure encrypted communication.

Troubleshooting

First of all, make sure that the COBI.wms Print Service and the Coresuite Service are both actually running. One or both of the services may have failed to start automatically after a server reboot. (If you don't have Coresuite Service, make sure that an SAP Business One Client with the Coresuite Designer add-on is running.)

If XML files are appearing in the PrintDirectory defined in the configuration of the COBI.wms Print Service, but the printing isn't working correctly, check the following:

If the XML files are not appearing in the PrintDirectory defined in the configuration of the COBI.wms Print Service, check the following:

If the COBI.wms Print Service is running but not logging anything at all, it means that it's not receiving any commands from the Android app, in which case double-check that the TCP Port is open and reachable from the Android devices. Otherwise, the log entries should tell you what the problem is.

Updating

  1. Stop the service.
  2. Extract the contents of the new ZIP file into C:\cobiwms-print-service\, overwriting existing files.
  3. Start the service.

Uninstall

  1. Stop the service.
  2. Run the following command in cmd.exe or PowerShell: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /u C:\cobiwms-print-service\cobiwms-print-service.exe
  3. Delete the folder C:\cobiwms-print-service\.