Controlling requester pipeline processing using a URI

In service requester pipelines, a message handler can determine where to send the web service request by changing the URI. By changing the URI format, you can choose to perform certain optimizations, such as starting another requester pipeline or starting a service provider pipeline without sending the request over the network.

Before you begin

Decide which options you want to implement in your requester pipeline. See Options for controlling requester pipeline processing for details.

About this task

The web service requester application can populate the DFHWS-URI container using the EXEC CICS INVOKE SERVICE command or, if no value is supplied by the application, CICS populates the container using the value in the web service binding file. To modify the URI, you must write a message handler that changes the contents of this container.

Procedure

  1. Write a message handler to modify the DFHWS-URI container according to one of the following URI formats:
    • To link to an application program, use the URI cics://PROGRAM/program, where program is the target application program. No data transformation takes place, so you must ensure that the application program can process the contents of the containers on the current channel. The application program can pass either the current channel and containers or a COMMAREA.
    • To start a provider pipeline without going through the network, use the URI cics://SERVICE/service?targetServiceUri=targetServiceUri, where service is the name of the service and targetServiceUri is the path of the service. The transport handler uses the path of the service to locate the URIMAP resource that resolves the request and passes it to the correct provider pipeline. CICS does not use the name of the service in its processing.

      An error occurs if no URIMAP resource is installed for the service. The URIMAP resource definition must also specify USAGE(PIPELINE). The transport handler puts the value of the targetServiceUri parameter in the DFHWS-URI container and starts the provider pipeline.

    • To start another requester pipeline, use the URI cics://PIPELINE/pipeline?targetServiceUri=targetServiceUri, where pipeline is the name of the PIPELINE resource that you want to start and targetServiceUri is the value that you want to pass to the next pipeline in the DFHWS-URI container.
    Each type of URI has additional parameters that you can add as a query string. For more information about the format of these URIs and the rules for coding them, see the DFHWS-URI container.
  2. Use an XML editor to add the message handler to the pipeline configuration file:
    <service>
      <service_handler_list>
        <handler>
          <program>MYPROG</program>
        </handler>
      </service_handler_list>
    </service>
  3. Disable, discard, and reinstall the PIPELINE resource for the requester pipeline to include your new message handler program in the pipeline.
  4. Install the message handler program in the CICS region.

Results

The next service request to run through the requester pipeline is processed by your new message handler.

What to do next

Test out the changes to your requester pipeline to make sure that the service requests are going to the correct location and that your message handler program is behaving as designed.