Implementing exit-http-resp-headers user exits

The exit-http-resp-header user exit provides access to any and all HTTP headers present in the response message from a SOAP Web service. When present, it is called from one to 100 times by InvokeService02 before the Web service is invoked.

Signature of Web Service HTTP-RESP-HEADER user exit function

C terminology:

Function_Name(int header, char * headerName, char * headerValue)

COBOL terminology:

 LINKAGE SECTION.
01 headerArrayPtr pointer.
01 headerCount    pic 9(9) usage comp-5.
01 header.
  03 namePtr      pointer.
  03 valuePtr     pointer.
01 headerName     pic x(1).
01 headerValue    pic x(1).
PROCEDURE DIVISION.
EXIT PROGRAM.
…
ENTRY "exit-http-resp-headers" using
     By value headerArrayPtr, headerCount.
           set address of header to headerArrayPtr
           perform headerCount times
               set address of headerName to namePtr of header
               set address of headerValue to valuePtr of header
               perform varying headerNameLen from 1 by 1
                       until headerName(headerNameLen:1) = low-value
               end-perform
               subtract 1 from headerNameLen
               perform varying headerValueLen from 1 by 1
                       until headerValue(headerValueLen:1) = low-value
               end-perform
.
     …
     EXIT PROGRAM.

The variables:

header
Number of the named value
headerName
Name of the named value
headerValue
Value of the named value

The variables use IMTK terminology:

header
Input parameter

This user exit is called repetitively from one to 100 times. The headerNum is just the index of the C for loop. The end of the loop occurs when:

headerName
Output parameter, null terminated string
headerValue
Output parameter, null terminated string