[JAX-WS] 3 ways to enable MTOM in JAX-WS on the server side

1. Enable using @javax.xml.ws.soap.MTOM annotation on the endpoint implementation class

@javax.xml.ws.soap.MTOM
@WebService(endpointInterface = "mtom.server.Hello")
public class HelloImpl implements Hello {
// ...
}

2. MTOM can be also be enabled on an endpoint by specifying enable-mtom attribute to true on an endpoint
element in sun-jaxws.xml deployment descriptor.

<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime'
version='2.0'>
<endpoint name="Mtom"
implementation="mtom.server.HelloImpl"
url-pattern="/hello"
enable-mtom="true"/>
</endpoints>

3. Enable using @BindingType on the endpoint (SEI) implementation class

@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)

will enable MTOM on the deployed endpoint for SOAP 1.1 binding

@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)

will enable MTOM on the deployed endpoint for SOAP 1.2 binding

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s