The problem with web service attachments is that lack of
supported standards. While MTOM/XOP is currently the preferred standard it is only supported by the most recent SOAP web service stacks. Earlier clients will only support a variety of even less well supported standards like DIME (not well supported under Java) and SOAP with Attachments (SwA) (not supported under .NET).
Given that you want to expose standard images it makes sense that you expose them as resources:
.../customers/{customerId}/image
.../customers/12345678/image
.../customers/87654321/image
The second one streams the image for customer 12345678 while the third one streams the image for customer 87654321. These images can be displayed in a browser or easily received programmatically.
Frameworks like
Jersey (JAX-RS; JSR-311) and
Restlet are used to build resources like these.
The Jersey Sample Applications The samples run on Glassfish - however
you should be able to run Jersey on
Tomcat. Restlet even has connectors to run on web servers like
Grizzly or
Apache MINA which perform better than servlet-based web servers (
Benchmark shows Restlet scalability).
[ December 11, 2008: Message edited by: Peer Reynders ]