Problem : The call to a remote REST web service fails/not working.
Custom BPM application calls a remote REST web service passing the username token. This fails and NO error is seen in BPM logs. Only after enabling the following trace loggers, "HTTP/1.1 401 Unauthorized" can be seen in the BPM logs :
In Admin console Infrastructure -> Nodes >> BPMNode >> Configuration >> Logging >> Add >> type in the loggers >> Set Appender >> Select BPM_ROOT from the list >> select level. >> Save and Apply. com.tibco.amx.governance (level=TRACE) com.tibco.amx.messageflow (level=TRACE) com.tibco.amx.bt.rest (level = TRACE)
like this : [httpConnector_60] [TRACE] [xxxx] com.tibco.amx.governance.pa.amxcomponent.pep.httpclient.HttpClientPepResponseInterceptor - == process(HTTP/1.1 401 Unauthorized [Date: Thu, 19 Aug 2018 14:30:58 GMT, WWW-Authenticate: BASIC, Content-Length: 0, Server: Jetty(8.1.16.v20140903)]) ==
This is because the request message to the REST web-service missed the username token. The username token in the request to the remote REST web-service can be missing if the UsernameTokenCM policyset is missing for REST reference binding.
To check if the UsernameTokenCM policyset is missing for REST reference binding :
Get the SystemNode logs from the times of deployment of the problem BPM application. In a WORKING scenario it should show "Added PolicySet UsernameTokenCM to node BPMNode" for the "RESTReference_Binding", like this :
08 Aug 2018 15:00:27,029 [amxAdminDefaultHttpConnector_80] [INFO ] [] com.tibco.amx.per.adminplugin.interceptor - Added PolicySet UsernameTokenCM to node BPMNode runtime sca uri urn:amx:BPMEnvironment/test.processes#reference-binding(_LthVsIwdEeiYqZTMt6xS-A1/RESTReference_Binding)___1.0.0.20180807161503708 for urn:amx:BPMEnvironment/test.processes/Test_PackagesPageFlow_1.0.0.20180807161503708_outbound_reference__LthVsIwdEeiYqZTMt6xS-A_RESTReference_Binding
In a PROBLEM scenario the above will be missing which would be the case of missing UsernameTokenCM policyset on REST reference binding.
Issue/Introduction
A call to a remote REST web service from custom BPM application never goes through. The remote REST web service sends an "HTTP/1.1 401 Unauthorized" response.
Resolution
Make sure the latest hotfix of "ActiveMatrix® Binding Type for REST 3.3.0" is properly installed and "com.tibco.amx.bt.rest.application.admin" application is created in the SystemEnvironment.
Then follow these steps : 1. Stop -> Undeploy and redeploy the REST BT plugin : "com.tibco.amx.bt.rest.application.admin" in the SystemEnvironment. 2. Redeploy the problem custom BPM application. 3. Test for the problem.
The REST BT admin plugin is responsible for pushing the REST reference policysets to nodes (at the time of deployment). For some reasons, like applying a hotfix etc, the REST BT plugin gets dropped from admin, leading to missing REST reference policysets.