Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How do I retrieve the MQRH2 header from the read function

Options

Can anyone help my with the below.

I am trying to retrieve a specific MQRFH2 header (Application (usr) Defined Properties). I tried using 'Extract' tab from 'Header Data Bank' but I am only receiving request header values. I am expecting Application (usr) Defined Properties. Would someone help with retrieving the RFH2 header.? Thanks

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,358 ✭✭✭
    edited July 2

    The Transport Header output only provides the MQMD headers which can be extacted using a Header Data Bank. In contrast, the MQRFH2 header and the message content are combined into a contrived XML document to simplify correlations and extractions. The document looks something like this (values omitted):

    <RFH2Message>
     <RFH2Headers>
      <mcd>
       <Msd></Msd>
       <Set></Set>
      </mcd>
      <psc>
       <Command></Command>
       <Topic></Topic>
       <SubIdentity></SubIdentity>
       <RegOpt></RegOpt>
      </psc>
      <usr>
       <myKey></myKey>
      </usr>
      <jms>
       <Dst></Dst>
       <Rto></Rto>
      </jms>
     </RFH2Headers>
     <Content>actual MQ message content goes here</Content>
    </RFH2Message>
    

    For correlations, you can paste a sample message (like the above) under Options > Request Template then configure correlations under Responder Correlation > Request Body.
    To perform extractions, you would chain an XML Data Bank to the Incoming Request Payload. You can similarly paste a sample message (like the above) into the Literal tab then switch to the Tree tab to select values to extract.