I am just getting started with SOAP web services and stumbled across MTOM.
I need to know 2 things based on following use case: A user will call a SOAP web service by passing an image. In response, they will get a formatted version of the same image.
I'll elaborate further as I gather more information and update this answer but on question one "JAX-WS applications require separate configuration of both the client and the server artifacts to enable MTOM support" and "the WSDL file includes a xsd:base64Binary or xsd:hexBinary element definition for the binary data." and also it may contain "xmime:expectedContentTypes"
On two, I believe this answers your question "JAX-WS applications require separate configuration of both the client and the server artifacts to enable MTOM support"
But again, still checking around for you.
More of an example of what you'd see in the WSDL
<xs:complexType name="ImageDepot">
<xs:sequence>
<xs:element name="imageData" type="xs:base64Binary" xmime:expectedContentTypes="image/jpeg"/>
</xs:sequence>
</xs:complexType>
........
</types
Mapping of MIME type and Java type. Describes the mapping between MIME types and Java types.
MIME Type Java Type
image/gif - java.awt.Image
image/jpeg - java.awt.Image
text/plain - java.lang.String
text/xml - javax.xml.transform.Source
application/xml javax.xml.transform.Source
/ javax.activation.DataHandler
So on your second question I believe it was the text would just still be considered an attachment but would have the type of text/plain