Setting Compression for REST Service Operations

This section discusses how to:

  • Set compression for provider REST service operations.

  • Set compression for consumer REST service operations.

PeopleSoft supports gzip and base64 (deflate) compression.

A REST service operation provider may request that inbound consumer requests be compressed using gzip or base64 (deflate) compression. The consumer is not required to send the data compressed.

The provider specifies the compression preference and the type of compression that the provider system can process on the routing definition using the Routings – Header Properties page. The compression preferences are then included in the WADL document that the provider furnishes to the consumer. The REST consumer can then view the compression preferences of the provider.

A REST service operation consumer may specify that a response from the provider be compressed using gzip or base64 (deflate) compression. The consumer specifies this request on the outbound request routing definition using the Routings – Connector Properties page. The compression requirement for the provider response is then included in the HTTP target connector headers. The REST provider can then ensure that its response meets the compression requirement of the consumer.

This section discusses how to set compression for Provider REST service operations.

Understanding Setting Compression for Provider REST Service Operations

You use the Routings – Header Properties page (IB_ROUTINGRESTPROP) to specify the compression method that the providing system will accept on inbound requests from a consumer, as well as the compression method the provider is using on the response to the consumer.

The two properties to use to specify message compression on the provider system are Accept-Encoding and Content-Encoding.

For provider request and response headers set compression as follows:

Field or Control

Definition

Provider Request Header

Use the Accept-Encoding property for the Request Header to indicate the compression method the providing system will accept on inbound requests from the consumer. The information you specify here is included in generated WADL documents that you provide consumers.

There are no values to select, rather you specify the compression method in the Comments field. The valid compression methods are:

  • base64 (deflate).

  • gzip.

Provider Response Header

Use the Content-Encoding property for the Response Header to indicate the compression method used on the outbound response to the consumer. The information you specify here is included in generated WADL documents that you provide consumers. The compression method used should match the compression method that the consumer specifies in the connector properties in the inbound request. The valid values are:

  • base64 (deflate).

  • gzip.

Setting Compression for Provider REST Service Operations

Use the Routings – Header Properties page (IB_ROUTINGRESTPROP) to set compression for provider REST service operations. To access the page, select PeopleTools > Integration Broker > Integration Setup > Routings and click the Header Properties tab.

Image: Routings – Header Properties page

This example illustrates the Routings – Header Properties page.

Routings - Header Properties page

The previous example shows that the Request Header is set to Accept-Encoding and that the provider will accept requests that are gzip or base64 (deflate) compressed. The example shows that the Response Header is set to Content-Encoding and that the provider will send its response to the consumer base64 (deflate) compressed.

To set compression for provider REST service operations:

  1. Access the Routings–Header Properties page:

    1. Select PeopleTools > Integration Broker > Integration Setup > Services and in the Existing Operations section click the name of the service operation. The Service Operations – General page appears.

    2. Click the Routings tab and in the Routing Definitions grid click the name of the routing definition. The Routing-Definitions page appears.

    3. Click the Header Properties tab.

  2. Set the request header.

    In the Request Headers section:

    1. In the Property Name field click the Lookup button and choose Accept-Encoding from the list.

    2. In the Comment field enter a comment regarding the compression method the provider system will accept for the inbound request from the consumer.

  3. Set the response header.

    In the Response Headers section:

    1. In the Property Name field click the Lookup button and choose Content-Encoding from the list.

    2. In the Value field click the Lookup button and choose the compression used for the response message to the consumer. The valid values arebase64 (deflate) or gzip.

  4. Click the Save button.

The other options featured on the Routings – Header Properties page are discussed elsewhere in the product documentation.

See Defining Routing Header Properties for Provider REST Service Operations.

This section discusses how to define compression for consumer REST service operations.

Understanding Setting Compression for Consumer REST Service Operations

A WADL document furnished to a REST consumer by a REST provider indicates if requests must be compressed and if so the compression method the provider system accepts. In addition, as a REST consumer you may require that responses from the provider be compressed and that the system can handle a specific compression method.

The two properties to use to specify message compression on consumer systems are Accept-Encoding and Content-Encoding.

For consumer request and response headers set compression as follows:

Field or Control

Definition

Consumer Response Headers

Use the Accept-Encoding property to indicate to the provider the compression method to use in its response to your consumer system. The valid options are:

  • base64 (deflate).

  • gzip.

Consumer Request Headers

Use the Content-Encoding property to indicate to the provider the compression method used on the outgoing request. The valid options are:

  • base64 (deflate).

  • gzip.

Setting Compression for REST Consumer Service Operations

You use the Routings – Connector Properties page (IB_ROUTINGRESTCPRP) to specify the compression method used for the outbound request and the compression method(s) the system can accept for the provider's response.

To access the Routings – Connector Properties page, select PeopleTools > Integration Broker > Integration Setup > Routings.

Image: Routings – Connector Properties page

This example illustrates the Routings – Connector Properties page.

Routing Definitions - Connector Properties page

The previous example shows that on the REST consumer has set Content-Encoding and Accept-Encoding to base64 (deflate). By setting the Content-Encoding property to base64(deflate), the consumer is indicating that it is sending the consumer request to the provider base64 (deflate) compressed. By setting the Accept-Encoding property to base64(deflate), the REST consumer is indicating to the REST provider that it will accept a response that is base64 (deflate) compressed.

To set compression for consumer REST service operations:

  1. Access the Routings – Connector Properties page:

    1. Select PeopleTools > Integration Broker > Integration Setup > Services and in the Existing Operations section click the name of the service operation. The Service Operations – General page appears.

    2. Click the Routings tab and in the Routing Definitions grid click the name of the routing definition. The Routing-Definitions page appears.

    3. Click the Connector Properties tab.

  2. Set the request header.

    1. In the Property Name field click the Lookup button and choose Content-Encoding from the list.

    2. In the Value field click the Lookup button and choose the compression method used for the outbound request. The valid values are base64 (deflate) or gzip.

  3. Set the response header.

    1. In the Property Name field click the Lookup button and choose Accept-Encoding from the list.

    2. In the Value field click the Lookup button and choose the compression method that the provider should use for the response back to the consumer. The valid values are base64 (deflate) or gzip.

  4. Click the Save button.

The other options featured on the Routings-Connector Properties page are discussed elsewhere in the product documentation.

See Defining and Overriding Gateway and Connector Properties.