Below are the typical issues (together with the solution) that one faces when submitting requests to the HTTP-based web services in Etlworks:
No detailed response in the log
If the HTTP request is executed with an error, but only the HTTP error code is displayed in the logs.
Solution: Add a more detailed message to the log. When configuring the HTTP Connection, select the option Add Response to Exception Log
.
Impossible to guess the URL
If a dynamic URL is used, it is impossible to figure out the actual URL for the request.
Solution: To add an actual URL to the log, select the option Add URL to Debug Log
when configuring the HTTP Connection.
View debug log from the Flows window.
View debug log from the Audit Trail window.
An HTTP Error code is in the response when it is actually a success
The web service returns an HTTP code that is, according to the standard, an error code for that specific HTTP method. However, it is actually a success for our web service.
Solution: Set exceptions from the standard HTTP error codes when configuring the HTTP Connection. Enter a comma-separated list of the exceptions in the Exceptions from Error Codes
field. When an HTTP request is executed, the return code will be compared to the list of standard error codes and the list of exceptions. The error will be generated only if the code is not on either list.
An HTTP Success code is in the response, but it is actually an error
The web service returns an HTTP code that is, according to the standard, a success code for the specific HTTP method. However, it is actually an error for our web service.
Solution: To set the HTTP codes that will be considered a success, enter a comma-separated list of the codes in the Success Codes
field when configuring the HTTP Connection. When an HTTP request is executed, the return code is compared to the list of standard success codes and the list of user-entered success codes. If the second list is not empty, only the codes from the second list will be considered a success.
Capture the response code from the HTTP call
If you enable the option Save HTTP Code into Global Variable
when configuring the HTTP Connection, the system will capture the HTTP response code and store it in the thread-safe global variable http_processor_last_http_code
.
To access this global variable, use the following JavaScript code:
var httpCode = com.toolsverse.config.SystemConfig.instance().getContextProperties().
get("http_processor_last_http_code"));
Comments
0 comments
Please sign in to leave a comment.