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 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.
Configuring an operation
Procedure
- 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.
- 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.
- Select Filter header values.
- 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.
- 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
Configuring a Subscribe action
Procedure
- Open the Subscribe action for your test.
- On the Config page, make sure that the Subscriber Configuration section is expanded.
- Make sure that the Participate radio button is selected.
- Select the Filter header values check box.
- 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.
- Click Ok to save your changes.