Forum Stats

  • 3,768,655 Users
  • 2,252,827 Discussions


Not able to open PDF attachment Sent from SOA Email activity

994181 Member Posts: 92


I have used email activity to send PDF attachment.  I am able to send PDF attachment but when i open it from mail box i get below error message -

Adobe reader could not open attachment.pdf because  it is either not a supported file type or because the file has been damaged (for example, it was sent as email attachment and wasn't correctly decoded).

i have used below java code for encoding data before sending -



  String temp1 = (String)getVariableData("EncodedTemp");         

oracle.soa.common.util.Base64Encoder Encoder = new oracle.soa.common.util.Base64Encoder();             

  java.lang.String Temp = null;                              

  Temp = Encoder.encode(temp1);            



catch(Exception e)                               




and i am using below mapping in assign activity for mapping attachment type in email -













Please let me know if i am missing anything here and help me to resolve this issue.

I tried to use one more mapping for contecntEncoding like below but it was giving selectionFailure exception.







  • AnatoliAtanasov
    AnatoliAtanasov Member Posts: 883 Silver Trophy
    edited Apr 13, 2018 5:49AM

    Before doing the base64 encoding what is the value of your variable that holds the attachment / PDF file? It could already encoded?!

  • 994181
    994181 Member Posts: 92
    edited Apr 13, 2018 5:53AM


    Values are normal text values that i am taking as inputs from the user.

    <element name="process">



    <element name="To" type="string"/>

    <element name="PDFBodyText" type="string"/>





  • Lawson Pereira-Oracle
    Lawson Pereira-Oracle Member Posts: 14
    edited May 3, 2018 12:44AM


    Could you try setting 'application/pdf' in mimeType instead of 'application/pdf;'..

    Assigning the values as below worked for me in sending data through the task file and opening it from mail.

                        <copy bpelx:insertMissingToData="yes">


                               <attachment xmlns="">

























    Also could you try adding the email content first without encoding it to check whether encoding actually causes the problem.

This discussion has been closed.