If you publish your service using XML, such as when deploying to a container, you can enable your endpoint's MTOM support in the endpoint's configuration file. For more information on configuring endpoint's see Configuring and Deploying Endpoints.
The MTOM property is set inside the jaxws:endpoint element for your endpoint. To enable
MTOM do the following:
Add a jaxws:property child element to the endpoint's
jaxws:endpoint element.
Add a entry child element to the jaxws:property
element.
Set the entry element's key attribute to
mtom-enabled.
Set the entry element's value attribute to
true.
Example 5.8 shows an endpoint that is MTOM enabled.
Example 5.8. Configuration for Enabling MTOM
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
<jaxws:endpoint id="xRayStorage"
implementor="demo.spring.xRayStorImpl"
address="http://localhost/xRayStorage">
<jaxws:properties>
<entry key="mtom-enabled" value="true"/>
</jaxws:properties>
</jaxws:endpoint>
</beans>