Question

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.
-
Like (0)
-
Accepted Solution

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());
}
}

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.

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

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

@LANH(ラン) 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
Accepted Solution

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());
}
}