Dev Center
This article is meant exclusively for the Service mode of
DWT
.
Dynamsoft Service is the core piece of DWT
when running in Service mode. It handles the communication between the hardware (scanner, webcam, etc.) and the browser, manages the image buffer, and coordinates data between different modules. There are two different contexts where installing the SDK applies: a development context or a client/end-user context. For the latter, installing the SDK just entails installing the Dynamsoft Service component since the service installation includes the installation of all the major modules of DWT
.
Refer to how to get dwt to download and install DWT
, the official installer is recommended in most cases.
Once DWT
has been integrated into your application and you have properly deployed your application on the server. Your clients will get prompted to install Dynamsoft Service
the first time they access your application. For more information on the process, check out installation of the Dynamsoft Service.
A: Yes, the installer is a .msi
file which requires administrator rights. If your organization doesn’t allow end users to have admin rights, you can contact Dynamsoft Support to get a special “Personal Installer” that doesn’t require admin rights.
NOTE
Once Dynamsoft Service is installed with admin rights, every user on that machine can use it. On the other hand, if it is installed with a “Personal Installer”, only that specific user can use it.
A: If an old version already exists, it is recommended that the user uninstalls the old version before installing the new one. Read more on how to uninstall the Dynamsoft Service.
Check out service mode update.
A: Yes. In a controlled environment, DWT
can be distributed to all clients in one go just like other similar programs. Group Policy is one such technology.
A: Yes. The following are the commands for this purpose
msiexec /i "/path/to/DynamsoftServiceSetup.msi" /qn
// Install
sudo installer -pkg /path/to/DynamsoftServiceSetup.pkg -target /Applications
// Stop service
sudo launchctl unload /Library/LaunchAgents/com.dynamsoft.dynamsoftservicex64.plist
// Start service
launchctl load /Library/LaunchAgents/com.dynamsoft.dynamsoftservicex64.plist
sudo dpkg -i /path/to/DynamsoftServiceSetup.deb
or
sudo rpm -i path/to/DynamsoftServiceSetup.rpm
C:\Windows\SysWOW64\Dynamsoft\DynamsoftService
and C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64(version)
Uninstall.pkg
. The file can be found in Go > Applications > Dynamsoft > WebTwain > {installed version No.}
Go > Applications > Dynamsoft > WebTwain > {installed version No.}
uninstall.sh
. The file can be found in opt/dynamsoft/DynamsoftService
opt/dynamsoft/DynamsoftService
There are some cases where you might not want to use the official installers of Dynamsoft Service.
Your application may have its own installer which installs other related components and it’s best if you can build Dynamsoft Service installer in there as well. In this case, you can feel free to include the official Dynamsoft Service installer (as is) in your overall installer to get it executed during the installation process.
The official Dynamsoft Service installer is digitally signed by Dynamsoft Certificates and it also shows multiple labels belonging to Dynamsoft. To rebrand it, you would need a white-label version of it. This usually involves the Customization Service. Contact Dynamsoft Support Team for more information.
The Dynamsoft Service uses localhost
and the ports 18622, 18625, 18623, and 18626 for connection. The latter two ports are used when there is an SSL encryption, and the earlier two when otherwise. These ports can be configured in the DSConfiguration.ini
file located in:
C:\Windows\SysWOW64\Dynamsoft\DynamsoftService(DynamsoftServicex64)\DSConfiguration.ini
(Windows)
By default, there are always three Dynamsoft Service processes running. All of them are called “Dynamsoft Service” and use the same file DynamsoftService.exe
. However, they are initiated with different arguments.
The main process starts without any argument as follows:
C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64\DynamsoftService.exe
Then there is a monitor process which is meant to monitor the main process and automatically start it in case it crashes. This one starts like this:
C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64\DynamsoftService.exe -asmonitor Global\Dynamsoft_1.5.0_352325843_stop_service_event Global\Dynamsoft_1.5.0_352325828_certcheck_event
The last always-running process is meant to support the SSL certificate specifically for the Firefox browser:
"-scan" "\\.\pipe\dynamsoftscan_15.0_70056_60" "0" "Global\ss352604281_61_70056" "0" "C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64\dwt_trial_15.0.0.0625.dll"
Service mode needs to be used if you wish to use a connected physical scanner. It is this Dynamsoft Service that handles all communication between the browser client and the scanner driver. As mentioned previously, Service mode is used by default if the user is on desktop.
NOTE:
- On Windows, the service runs in the “Local System” account
- On macOS, the service runs in the “current user” account
- On Linux, the service runs in the “root” account
There are multiple files and folders in the service directory. We’ll take the Windows service as an example. The directory is C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64_16
and the content is (you may not see all these files on your own machine)
\cache\
: Data cached on the disk. Check out Disk Caching.\cert\
: The certificates used for SSL connection. Check out How to change the certificates.\dump\
: Dump files in case the service crashes.\log\
: Log files for debugging purposes.\upload\
: Temporary location for image data to be uploaded by the file uploader.DSConfiguration.ini
: Service configuration file. Check out How to configure the service.DWASManager_16000428.dll
: The service manager. The name of the file may vary among different versions.DynamsoftService.exe
: The service.DynamicSocket.dll
: For socket connections.service.ini
: Define service name.user_config.ini
: User configuration file.welcome.htm
: The home page for the service (present when you visit http://127.0.0.1:18625)NOTE
These files are named with their version number. Different versions of
DWT
will have different files. The following uses v16.1.1 as an example.
dwt_16.1.0.0728.dll
DSSCN2.exe
DSSCN2x64.exe
TWAINDSM.dll
TWAINDSMx64.dll
\x64\
\x86\
dbr_7.4.0.0428.dll
dbrx64_7.4.0.0428.dll
DynamicPdfCore_11.0.0.0428.dll
DynamicPdfCorex64_11.0.0.0428.dll
DynamicPdfR_11.0.0.0428.dll
DynamicPdfRx64_11.0.0.0428.dll
DynamicWebcam_15.0.0.0625.dll
DynamicWebcamx64_15.0.0.0625.dll
\DynamicOCR\
DynamicOCR_10.0.0.0618.dll
DynamicOCRx64_10.0.0.0618.dll
\OCRProResource\
DynamicOCRPro_1.2.0.0806.dll
DynamicOCRProx64_1.2.0.0806.dll
ocrp.lic
OCRPro.lic
UploadModule_1.6.0.0428.dll
DynamicImage.dll
DynamicImagex64.dll
favicon.ico
: The favicon.legal.txt
: Legal notice.libcurl.dll
: The file transfer library.libeay32.dll
ssleay32.dll
port.lock
Dynamsoft Service sets up a local HTTP service that accepts requests from JavaScript code running in the browser and performs operations accordingly. The following are a few examples.
NOTE
These requests are handled by the JavaScript client of the library. Please do not try to make similar requests in your own code without consulting Dynamsoft Support.
https://127.0.0.1:18623/fa/VersionInfo?ts=1603161807908
{
"id" : "1",
"method" : "VersionInfo",
"result" : [ "16, 1, 0, 0728", "", "64" ],
"cmdId" : ""
}
https://127.0.0.1:18623/f/RemoveAllImages?753350643
{
"id" : "414778098",
"method" : "RemoveAllImages",
"result" : [ true ],
"cmdId" : ""
}
https://127.0.0.1:18623/dwt/dwt_16100728/img?id=414778098&index=5&width=585&height=513&ticks=1603162807999
Response in case of success
The image data.
A: To replace the default certificate, the steps are
server.pem
, (public) server_key.pem
(private)C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64_16\cert
A: Generally, we configure the service in the file DSConfiguration.ini
[DS]
DSVersion = 1, 6, 1, 0728 // Version of the service, readonly
Port_mn_0 = dcp
Port_mp_0 = 18625 // Port of the Service
Port = 2
SSLPort_mn_0 = dcp
SSLPort_mp_0 = 18626 // SSL Port of the Service
SSLPort = 2
Port_mn_1 = dwt
Port_mp_1 = 18622 // Port of the core scanning module
SSLPort_mn_1 = dwt
SSLPort_mp_1 = 18623 // SSL Port of the core scanning module
LogLevel = 1 // Whether to output detailed information for debugging purposes
A:
A: There are a few possible causes
The respective fixes are listed below
C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64_16
and make sure you have the correct files.Local Services
and make sure Dynamsoft Service is listed and Running.version 16.2