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. How do I send a file to the client? (and how can I tell them to upload one).
Files are generally transferred by encoding them with Base64 and putting them in xsd:base64binary
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:base64Binaryhas. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With