Skip to content
VirtualLP Virtual Learning Platform
Web Services CC-P06 advanced

Practical 6: Upload and download images with MTOM

Build a SOAP media service that receives and returns binary files as MTOM/XOP attachments, validate type and size, upload a real PNG from a Java client, download it again, verify integrity and open the copy.

What you'll do

  • Enable MTOM on a JAX-WS service
  • Validate file type and size on the server
  • Send byte[] as binary attachments instead of base64
  • Verify the integrity of downloaded files

Lab tasks

  1. 1 Enable MTOM and add validation
  2. 2 Deploy the MTOM-enabled service
  3. 3 Generate an MTOM-enabled client
  4. 4 Upload, download and verify
  5. 5 See the binary attachment on the wire
  6. 6 Open the downloaded image
  7. 7 Reject an invalid file type