OK, I've managed to get this working - well sort of...
This works fine using the EchoAttachment example after removing the commented-out DIME bits (and fixing the missing import statements). However, my colleague is attempting to communicate with this service using the Microsoft SOAP toolkit (v3.0), but the attachment does not get echoed as a DIME attachment - in fact it gets lost and the (valid SOAP envelope) response is returned as text/xml instead of application/dime.
An error message of 'dh is null' is printed to the JBoss console in this instance, whereas 'Received "javax.activation.DataHandler"' is printed to the console when I run the Java client.
Does anyone have enough knowledge to pinpoint why this data handler is getting set to null, or perhaps suggest a good way to debug what's actually going on?