views:

152

answers:

2

Hi! So i'm writing a WebService in Java that should receive a file as an input, and then the WebService does some processing on that file, and finally it should send a new file to the client.

My question is : How do I send a file to the client? (and how can I tell them to upload one).

Thanks for the help

+1  A: 

Files are generally transferred by encoding them with Base64 and putting them in xsd:base64binary

Bozho
+1  A: 

For large file, look for MTOM (Message Transmission Optimization Mechanism). From JAX-WS Metro Guide: Binary attachment:

MTOM is efficient, in the sense that it doesn't have the 33% size increase penalty that xs:base64Binary has. It is interoperable, in the sense that it is a W3C standard. However, MIME multipart incurs a small cost proportional to the number of attachments, so it is not suitable for a large number of tiny attachments.

ewernli