Return a VSI response as PDF file
search cancel

Return a VSI response as PDF file

book

Article ID: 126760

calendar_today

Updated On:

Products

CA Application Test CA Continuous Application Insight (PathFinder) Service Virtualization

Issue/Introduction

This document describes the steps taken to configure a VSI transaction to send a PDF file in the response.

Environment

All supported DevTest releases.

Resolution

Open the VSI and select the transaction that will return the PDF file as response.

Go to the response and change the response editor to General/ Binary.

 

Once you change the type of payload, the response tab will show three icons:

 

Select the first icon. It allows us to load the content of a local file into the response body.

Select the PDF file to be sent as response:

 

Select the second icon to save the content of the response body to a new local file.

 

Open the new file in a text editor and add the following information to the text file.

In the first line add:
------=_Part_0_1578916788.1457518808008 Content-Type: application/pdf Content-Transfer-Encoding: binary Content-ID: <EBF7DF6EAB32B0970B33B96138F6C306> 

In the last line add:
------=_Part_0_1578916788.1457518808008---------- 

There are no spaces and empty lines before and after these lines.


Save the modified file. 

Back in the VSI response, reload the modified PDF file in the response, using the load icon.

 

In the Response Meta Data, modify or add the the header Content-Type = application/pdf.

Save the VSI and deploy the VSM to the VSE Service.

This will load the PDF file when the request sent matches this specific transaction.

To send the PDF file as an attachment that will be downloaded to the local 'Download" folder, add the Content-Disposition as attachment:

Save the VSI and deploy the VSM to the VSE Service.

Attachments

1558689560502000126760_sktwi1f5rjvs16fzh.png get_app
1558689558677000126760_sktwi1f5rjvs16fzg.png get_app
1558689556842000126760_sktwi1f5rjvs16fzf.png get_app
1558689555100000126760_sktwi1f5rjvs16fze.png get_app
1558689553455000126760_sktwi1f5rjvs16fzd.png get_app
1558689551722000126760_sktwi1f5rjvs16fzc.png get_app
1558689548451000126760_sktwi1f5rjvs16fzb.png get_app