Error receiving response data separated by --binary option in jboss in WinDirector's GetResource API

The following error occurred when trying to receive response data separated by --binary option.(WinDirector's GetResource API)

[error]

com.pega.pegarules.pub.services.InboundMappingException: Caught throwable while accessing message body: Failed to link javax/mail/MultipartDataSource

Please help me.

@HiroakiS6393

If can please capture the Connect-REST on Post Respone. In case response is binary data, you don’t need setting any thing in message data.

@LATHAN(ラン)

Sorry for the late reply.
Attach the capture.
“.token” is a text type.

@HiroakiS6393

Please try set empty マップ先 and マップ先キー。The response will auto set to pyResponseAttachmentPage

https://docs-previous.pega.com/data-management-and-integration/86/file-attachment-configuration-rest-and-soap-integrations

@LATHAN(ラン)
Thank you for your reply!!

After test, we will send you the result.

@LATHAN(ラン)
We try it, but pyResponseAttachmentPage is empty.

@HiroakiS6393

What is type of content type on response?

Can you change class in Logging level settings to DEBUG and share Pega log file when run Connect REST ?

Please check value in property pyResponseAttachmentPage.pyAttachValues(1) or pyResponseAttachmentPage.pyAttachNames(1)

com.pega.pegarules.integration.engine.internal.connect.rest.RESTConnector 

@LATHAN(ラン)
Content type of the file is multipart/form-data.
We check pyResponseAttachmentPage.pyAttachValues(1) and pyResponseAttachmentPage.pyAttachNames(1), but there is no response when I press the plus button.
We are facing the following error and think it is a problem before the page you advised.

[error]

com.pega.pegarules.pub.services.InboundMappingException: Caught throwable while accessing message body: Failed to link javax/mail/MultipartDataSource

@HiroakiS6393

I think because of content type is multipart/form-data so you can’t inbound content to Text property. When response is multipart/form-data, pega default set it into pyResponseAttachmentPage pega

Please test download file by add the java method below after using connect rest in activity or add activity in Post load processing in case use Data Page connect rest

final ClipboardPage attachPage = tools.findPage("pyResponseAttachmentPage");

if (attachPage != null){
  
  fileName = attachPage.getProperty("pyAttachNames(1)").toString();
  ClipboardProperty attachVals = attachPage.getProperty("pyAttachValues(1)");
  byte[] byteArray=Base64Util.decodeToByteArray(attachVals.toString());
  try{
      String sErrorMessage = tools.sendFile( byteArray, fileName, false, null, true ); 
}catch (Exception e) {
 oLog.error("Error file: " + e.getMessage());
}
}