Using attachments with REST, SOAP, SAP, dotNet, and HTTP connectors and services

REST, SOAP, SAP, dotNet, and HTTP connectors and services use a common approach for handling attachments.

Note: SAP, dotNet, and HTTP connectors and services are no longer being actively developed, and are being considered for deprecation in upcoming releases. Using these rules does not follow Pega development best practices.

For HTTP connectors and services, use Connect REST rules and Service REST rules instead. For more information, see Connect REST rules and Service REST rules.

For SAP and dotNet connectors and services, use Connect SOAP rules and Service SOAP rules instead. For more information, see About Connect SOAP rules and Service SOAP rules.

Sending attachments from your application

Connectors

When building the outbound message content for a REST, SOAP, SAP, dotNet, or HTTP connector, Pega Platform looks for a top-level clipboard page named pyRequestAttachmentPage of type Data-ServiceMessage. If it finds the page in the clipboard, it adds attachments to the outgoing message for every string value found in the pyAttachValues Value List property on the page. Each string is assumed to be a Base64-encoded representation of a binary data value. This page must be created and populated prior to invoking the connector.

Services

The same general model applies for REST, SOAP, SAP, dotNet, and HTTP services; but the top-level page is named pyResponseAttachmentPage since the attachments are added to the outgoing service response message.

Receiving and processing attachments

Connectors

To process attachments that have been received as part of a connector response message, configure your connector activity to look for a top-level clipboard page named pyResponseAttachmentPage of type Data-ServiceMessage after the connector has been invoked. If the page exists, any attachments that were received appear as Base64-encoded values in the pyAttachValues value list property on the page. The typical use case is to iterate over the list of attachments and associate them with a work object.

For multi-part responses, if you configure a response mapping, the first part of the multi-part message is considered the response body, and the rest of the parts are put onto the pyResponseAttachmentPage.

Services

The same general model applies for REST, SOAP, SAP, dotNet, and HTTP services; but the top-level page is named pyRequestAttachmentPage since the attachments are received as part of the inbound service request message.

Integration-Connectors category