IBM Support

Content in DFHMEDIATYPE container ignored when return responses for GET and DELETE requests

Question & Answer


Question

I am able to process an incoming request and return response and status using DFHRESPONSE and DFHHTTPSTATUS containers in CICS Transaction Server for z/OS (CICS TS). But, the content of DFHMEDIATYPE container seems to be ignored when I return responses for GET and DELETE requests. I get the expected result when doing the same for POST and PUT requests.

Here is the response returned for the GET and DELETE requests:

 HTTP/1.1 200 OK
 Date: Tue, 13 Aug 2019 18:40:03 GMT
 Server: IBM_CICS_Transaction_Server/5.3.0(zOS)
 Content-Type: text/xml; charset=UTF-8
 Content-Length: 000000000000724
 Connection: Keep-Alive
 
 {    "accountCode": "25620001",   +++++(response truncated)

The Content-Type is set to "text/xml" independent of what I put into DFHMEDIATYPE container. I have tried to set it to application/json and text/plain but it is always set to text/xml. Setting to application/json or text/plain works for POST and PUT requests.

Answer

The most likely cause of the content in the DFHMEDIATYPE container being ignored is that the PUT CONTAINER, for DFHMEDIATYPE, was done as a BIT container instead of CHAR container. This will cause the later GET CONTAINER, issued by CICS, to fail and cause the default text/xml to get used.

When doing the POST and PUT, CICS code has already created the DFHMEDIATYPE container as a CHAR container with the value from the inbound request. This means the user terminal handler issuing EXEC CICS PUT CONTAINER will use CHAR instead of BIT under the covers because the container already exists.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGMGV","label":"CICS Transaction Server"},"Platform":[{"code":"PF035","label":"z\/OS"}],"Component":"Web Services","Version":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Product Synonym

CICS/TS CICSTS CICS TS CICS Transaction Server

Document Information

Modified date:
14 August 2019

UID

dwa1514817