I am trying to make a very simple web-service which does the following:
- The client hits the web service requesting a file.
- 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)
- 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:
I understand we encode files to base64 for transmission via web service, but where and how does MTOM come into the picture there?
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)"??