Sun Java System Web Server 7.0 Update 7 Performance Tuning, Sizing, and Scaling Guide

Use DataHandlers for SOAP Attachments

Using a javax.activation.DataHandler for a SOAP attachment improves performance.

JAX-RPC specifies:

As a result, send a SOAP attachment as a .gif or XML file to an RPC style web service by utilizing the Java type mappings. When passing in any of the mandated Java type mappings which are appropriate for the attachment's MIME type as an argument for the web service, the JAX-RPC runtime handles these as SOAP attachments. For example, to send out an image or a gif attachment, use java.awt.Image, or create a DataHandler wrapper over your image. The advantages of using the wrapper are: