Bookmark and Share

Recent Posts

Enhancements for Db2 Native REST Web Services

January 16, 2018

Enhancements for Db2 Native REST Web Services IBM recently released some fixes and new functionality for Db2 for z/OS. If you're currently using and or planning to use Db2 native RESTful web services, you should apply this maintenance. For Db2 11, apply APAR PI86867; for Db2 12, apply APAR PI86868.

These APARs address a number of issues customers are experiencing with RESTful web services, also known as REST services or, from the developer's point of view, RESTful APIs. The links in the first paragraph provide complete details, but I’ll summarize the capabilities the APARs provide: 

1) Currently REST services can be created and dropped through client applications or tooling; however, DBAs have asked for a method that is similar to managing Db2 packages. The new DSN subcommands, BIND SERVICE and FREE SERVICE, provide this capability. 

2) The current behavior of the DB2 native REST services is that DB2 closes the HTTP connection/socket immediately after processing each REST request. This can lead to poor performance. The APARs include support for persistent connections. Each connection will remain open for 15 seconds. If the request fails or is used with a create, free or discover service, then the connection is closed immediately.

3) If a Db2 native REST service request includes both basic authentication and SSL client certificate authentication, but there is no matching Db2 trusted connection definition for the supplied client certificate, authentication would ABEND with SOC4, LOC=DSNLDTML.DSNXATUM+007C2. Db2 has been corrected to return the expected error message.

4) When using the Db2 native REST service manager API to create a Db2 user defined REST service, this action could succeed even when some bind options that are inapplicable for a REST service are specified. The service now returns an error message and fails the request under these circumstances.

5) Db2 install job DSNTIJRS is used to create Db2 database objects and DDF native services. Without the appropriate APAR applied, the Db2 DDF native REST service checks for these database objects during startup of DDF. This requires DDF to be cycled after running job DSNTIJRS. With this maintenance, Db2 detects the DDF REST database object and does not require a DDF restart.

6) The built-in DB2ServiceDiscover service can be used to discover and list all available DB2 native REST services, using:
            POST /services/DB2ServiceDiscover

However, a POST invocation of DB2ServiceDiscover service with NO input JSON body would fail with this error message:

"StatusCode": 500,
"StatusDescription": "Execution failed during
DB2ServiceDiscover due to an internal server error.
Please contact IBM support Error Location:DSNLJDSC:50"

The updated DB2ServiceDiscover service code will work correctly when the request does not include an input JSON body.

Please share your experiences with Db2 native RESTful web services and your thoughts on these enhancements.

Posted January 16, 2018| Permalink

comments powered by Disqus