Give a try with below, it works if the pdf is encoded in base64 but not as Binary. If the client accepts base64 it will suffice the requirement.
{
"name": "attachPDF",
"port": 30009,
"protocol": "http",
"stubs": [{
"responses": [{
"is": {
"statusCode": 200,
"headers": {
"HTTP-Response-Code": 200,
"HTTP-Response-Code-Text": "OK",
"X-Backside-Transport": "OK OK,OK OK,OK OK",
"Connection": "Keep-Alive",
"X-Global-Transaction-ID": "a5df1c57540d",
"Content-Type": "application/xml",
"LittleEndian" : "false",
"ByteAlign" : "true",
"Content-Type": "Multipart/Related; boundary=MIME_boundary",
"MIME-Version" : "1.0",
"Content-Description" : "Value"
},
"body": "<%- stringify(filename, 'payload/attachPDF.txt') %>"
}
}],
"predicates": [{
"contains": {
"method": "POST",
"path": "/path"
}
}]
}]
}
attachPDF.txt
--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
<XML or Wrappers if any>
--MIME_boundary
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
<encoded base64 string>
--MIME_boundary--
Thanks,
PK