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 733155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:13:28+00:00 2026-05-14T07:13:28+00:00

I am trying to make a very simple web-service which does the following: The

  • 0

I am trying to make a very simple web-service which does the following:

  1. The client hits the web service requesting a file.
  2. The web service’s service class queries a hashtable which has the key (search query) and the value as the base64encoded value of a file (say a pdf)
  3. Now,I need to use MTOM to return the base64encoded value stored in the hashtable to the client.

It’s upto the client to decode it and convert it to pdf.

So, here are my questions:

  1. I understand we encode files to base64 for transmission via web service, but where and how does MTOM come into the picture there?

  2. Can some one provide me a simple method which uses MTOM and sends the data back. Do we need to specify something in the WSDL too? or a simple String return type would suffice? Why/Why not?

Thanks

I have seen this code. It uses a lot of annotations, I just need a simple java code using MTOM. New to J2EE HERE 🙂

UPDATE 1

Decent enough explanation here, now I need to understand it from the implementation level.
Good info here, but for .Net

UPDATE 2

What should be the return type of the method “createMTOM(int id)”??

  • 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-14T07:13:28+00:00Added an answer on May 14, 2026 at 7:13 am

    You seem to be mixing up implementation and protocol.

    The specification for MTOM is here. This page has sample messages.

    If you are using a JAX-WS environment, you most assuredly use Annotations to turn it on. If you are rolling soap messages by hand, you write whatever Java code you need to write to produce it. Essentially, MTOM means that the content of the data move to an attachment, which is a separate MIME part of the message, and is referenced through an xop:Include element with an href to the MIME part.

    The schema has to say base64Binary as the element type, but additional attributes give hints as to the interpretation of the bytes: xmime:contentType and xmime:expectedContentType. In my experience, the JAX-B reference implementation has some limitations on the use of these. You can’t, for example, get it to automatically convert text back and forth to bytes. In a typical kit like CXF or Glassfish, you put data into a DataHandler and the kit turns it into the attachment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to make a very simple YACC parser on Pascal language which just
Im trying to make a very simple application that lets my client create their
I'm learning java and I'm trying to make a very simple application that does
I am trying to make a very simple object rotate around a fixed point
I'm trying to make a very simple OSGi test but I can't get it
I'm learning Objective-C and trying to make a very simple command line calculator. 'S'
I am trying to make a (very) simple Data Binding test, but it doesn't
Basically what I'm trying to do is make a very simple vertical bullet projectile
I am trying to do a very simple bash script which emulates the behavior
I am trying to make a very simple application. With a starting menu as

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.