REST Web Services - .WAR file is too small and REST does not work

Document ID : KB000009309
Last Modified Date : 27/04/2018
Show Technical Document Details
Issue:

After running pdm_rest_util -deploy, RESTful web services no longer work as expected. In addition, the caisd-rest.war file appears to be much smaller than the normal ~4.5MB that it normally is.

Running pdm_configure and verifying the REST-related settings has no effect.

If advanced logging is enabled on REST by following the process at this link prior to running pdm_rest_util -deploy, the file nx_root\log\jrest.log contains lines stating "REST METHODS = 'NONE'", "Skipping CREATE method", "Skipping UPDATE method", and "Skipping READ method" for every factory except for "rest_access". Some factories may show additional errors about "Unsupported (dotted attribute)". These errors look like the highlighted lines in the following image:
jrest.log Method Deploy Errors.png
 

Environment:
This problem occurs in Service Desk Manager environments where RESTful web services have been configured.
Cause:

The most likely cause is the Options Manager option "rest_webservice_resources_to_expose" has been installed, but has not been configured from its' default value of "rest_access". This option is intended to restrict REST calls to only the specified factories. When this option is not installed, no restrictions are in place, and all factories normally accessible via REST are available. When this option is installed, only the specified factories are available - by default, this is only the "rest_access" factory. If this option is installed, but not configured, most REST calls will fail to process correctly, and we will see the noted "REST METHODS = 'NONE'" lines in jrest.log (if advanced logging is enabled).

Resolution:

If you do not wish to restrict which REST methods and factories are accessible, deinstall the "rest_webservice_resources_to_expose" option. You can locate this option within the SDM web UI > Administration tab > Options Manager > Web Service section. Alternatively, you can search for the option by name, or can search for "rest%" to find it more easily.

Once the option is deinstalled, restart Service Desk Manager for the option to be effective.

If you would prefer to restrict the available methods and factories, you will need to configure this option by providing a comma-separated list of REST methods that should be made available. If advanced logging has been enabled on REST, jrest.log will contain multiple lines with the phrase "Constructor: factory" - searching the file for all lines that contain "Constructor: factory" will yield a list of all available factories.

After making either change above, you will need to run the pdm_rest_util -undeploy and pdm_rest_util -deploy commands again so that your changes will take effect.

After this issue has been resolved, caisd-rest.war should be approximately 4.5MB in size, and REST calls should function as normal. If you have it enabled, debug-level logging on jrest.log should look like the highlighted lines in the following image:
jrest.log Method Correct.png
Note: For most factories, it's okay and expected to have the line "Skipping DELETE method", as deleting items is generally unsupported across Service Desk Manager as a whole.

Additional Information:

If "rest_webservice_resources_to_expose" is installed, you may also experience issues with the CA Service Management mobile app as noted in the following documents:
TEC1339974 - Receiving the following error after logging into the SDM Mobile App: Login to Analyst Queue not Found.
TEC1013489 - "The resource you requested was not found on the server" seen from CA Service Management mobile application

For more information on the "rest_webservice_resources_to_expose" option:
Options Manager - Web Service Options - CA Service Management 17.0

For more information on enabling advanced logging on REST:
REST Logging - CA Service Management 17.0

 

If you are still experiencing issues after following the recommendations above, please open a chat session or support case with CA Support.