Sending and Receiving Binary Data for Consumer REST Service Operations

When sending encoded binary data for REST consumer-based service operations, you must use the HTTP target connector. The HTTP listening and target connectors provide a web-standard method for an integration gateway to exchange messages with both PeopleSoft and third-party applications. See Integration Broker Administration: Using the HTTP Target Connector.

Http Properties to send and receive binary data:

  • Base64toBinary

  • Response-Binary

Sending Binary Data for Consumer REST Service Operations

To send binary data the developer must base64 encode the binary data add it to the message via &MSG.SetContentString(). The Developer must also set the http property as follows:

&bRet = &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties("Base64toBinary", "Y", %HttpProperty);

Receiving Binary Data for Consumer REST Service Operations

To receive binary data the developer must set this http property as follows:

&bRet = &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties("Response-Binary", "Y", %HttpProperty);

The data returned in the message will be base64 encoded.

&MSG.GetContentString();

The developer will first need to decode the data to get the actual binary data.

To allow HTTP target Connector to accept binary response data, check for the following response content types:

  • application/octet-stream

  • application/x-binary

However, for the following response content types, there is no need to set the Response-Binary http property as Integration Broker will treat the data as binary and base64 it:

  • application/octet-stream

  • application/x-binary

  • image