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 Web Service 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'sjaxws:endpoint
element.Add a
entry
child element to thejaxws:property
element.Set the
entry
element'skey
attribute tomtom-enabled
.Set the
entry
element'svalue
attribute totrue
.
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>