Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3601278
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:36:05+00:00 2026-05-18T20:36:05+00:00

I want to send a pdf file within a xml message. How do I

  • 0

I want to send a pdf file within a xml message.
How do I do that in java? What data type do I use in the schema?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:36:06+00:00Added an answer on May 18, 2026 at 8:36 pm

    You can transform the PDF file to Base64 Binary and wrap this into a container Element with type xs:base64Binary. For example you could use this schema definition to place your PDF file in the xml message.

    <xs:complexType name="documentType">
     <xs:sequence>
        <xs:element minOccurs="0" name="mimetype" type="xs:string" />
        <xs:element minOccurs="0" name="filename" type="xs:string" />
        <xs:element name="content" type="xs:base64Binary" />
     </xs:sequence>
    </xs:complexType>
    

    You can use org.apache.commons.codec.binary.Base64 for this approach if you already have commons-codec in your project. It support use of chunked data and strings. For example:

    // You can read in the PDF file with FileReader and get the bytes
    // Please obey that this solution must be improved for large pdf files
    
    Base64.encodeBase64(binaryData, true)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send a pdf file within a xml message. How do I
i have code that generates a pdf file and i want to send it
Hello Sir i want send list of data to php server i use following
I'm trying to create a method that will send a PDF file directly to
I want to show a Save As dialog when I send the PDF file
I want so send every week an update by email. But Im afraid that
I want to send a binary file to .net c# component in the following
I have a method that returns a PDF file using DOMPDF . It sends
I want to encode a file it may be image or any pdf and
Let's say i want to download a file called example.pdf from http://www.xxx.ууу/example.pdf Probably, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.