Troubleshooting RESTful API

This section provides information about how to troubleshoot RESTful API issues.

Debugging parameters

The following three parameters are most frequently used for debugging RESTful API:

  • debugrest

    Add debugrest in sm.ini or in the dedicated servlet container line of the sm.cfg file, restart the Service Manager and re-run the RESTful Web service application to invoke debugging parameter. It provides more detailed log trace for diagnostics.

  • dao_threadsperprocess

    Similar to debugrest, it can be set in sm.ini or in the dedicated servlet container line of sm.cfg file.

    It means the maximum number of threads allowed concurrently running in the process for RESTful Web Service application. It can be defined in sm.ini and the default value is 10. It is better to start enough server threads to handle requests (suggest to maintain the buffer of 30%~ 40% spare capacities).

  • dao_sessiontimeout

    Like debugrest, the dao_sessiontimeout parameter can be set in sm.ini or in the dedicated servlet container line of sm.cfg file.

    It indicates the seconds to wait before terminate the RESTful threads. It can be defined in sm.ini and the default value is 15 seconds. Unless the client sends subsequent requests within the timeout, the Service Manager server will recycle the session for re-use and re-allocate it on demand.

    If there is big divergence, it is recommended to connect several servlets with different thresholds.

It is also useful to use the msglog:1 parameter to have all messages written to the sm.log as well.

Web services with a proxy server

If you are using web services with a proxy server, incorrect proxy server settings will cause your web service calls to fail. For details, see Web Services with a proxy server.