Filtering header values

If you are using a stub to test more than one web service from a single URL, you can use header values to distinguish between the services.

About this task

You can filter header values in two situations:
  • You can configure an operation to bind to a specific web service, then record or create a stub from the operation.
  • You can configure a Subscribe action independently of any operation.
The interface is similar in both cases. Specify a header type and a value to match in the header.

Configuring an operation

Procedure

  1. In the Logical view of the Architecture School perspective, edit the operation you plan to stub or record. You can double-click the operation or right-click the operation and click Open.
  2. In the Binding section of the Stub page, make sure a Transport is specified.
    If the Operation is created by the Recording Studio Save wizard, the transport is specified automatically.
  3. Select Filter header values.
  4. Click New to add a new header to the list.
    For each header, complete the following fields:
    Name
    The header type. Typically the type is SOAPAction.
    Value
    No restrictions are placed on the value. In this case, specify a SOAPAction header and a URI that identifies the service, enclosed in quotation marks.
    Note: SOAPAction header values are expected to be quoted. Quoted empty string and unquoted empty string are treated as different (unequal) values.
    Enabled
    If a header is present but the corresponding checkbox is not selected, that header is not used as a filter.
  5. Click OK to save your changes.
    Note: Messages are filtered on the basis of header values at the operation level before the sift-and-pass-through settings of a particular stub are applied. If you do not see expected messages being routed to the stub, check to see if they are being filtered because of header values. For more information, see Sift-and-pass-through capability.

Results

When you create a stub or record from the operation, only the specified service is used.

Configuring a Subscribe action

Procedure

  1. Open the Subscribe action for your test.
  2. On the Config page, make sure that the Subscriber Configuration section is expanded.
  3. Make sure that the Participate radio button is selected.
  4. Select the Filter header values check box.
  5. Click New to add a new header to the list.
    For each header, complete the following fields:
    Name
    The header type. Typically the type is SOAPAction.
    Value
    No restrictions are placed on the value. In this case, specify a SOAPAction header and a URI that identifies the service, enclosed in quotation marks.
    Note: SOAPAction header values are expected to be quoted. Quoted empty string and unquoted empty string are treated as different (unequal) values.

    The Enabled check box is selected by default. If you want to temporarily disable the filter, you can clear this check box.

  6. Click Ok to save your changes.