MTOM in JAXWS 2.0 RI EA3
By default MTOM encoding is disabled. To enable MTOM on a service all you need to do is to add enable-mtom attribute on the endpoint descriptor element.
Here is a sample descriptor from the mtom sample:
<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime'
version='2.0'>
<endpoint
name="Mtom"
implementation="mtom.server.HelloImpl"
wsdl="WEB-INF/wsdl/hello.wsdl"
service='{http://example.org/mtom}HelloService'
port='{http://example.org/mtom}HelloPort'
url-pattern="/hello"
enable-mtom="true"
mtom-threshold-value="0"/>
</endpoints>
On the client side, you can use SOAPBinding.setMTOMEnable(). For example,
Object port = new HelloService().getHelloPort ();
//get the binding and enable mtom
SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding ();
binding.setMTOMEnabled (true);
Thats pretty much what you need to do to enable MTOM. For details see the MTOM online documentation in jaxws-ws project on java.net. to try the sample, assuming you have JWSDP 2.0 installed with S1AS 8.2_02, try the mtom samples: $JWSDP_HOME/jaxws/samples/mtom and $JWSDP_HOME/jaxws/mtom-soap12. Here $JWSDP_HOME is where you installed JWSDP 2.0.
You can post your queries to jax-ws dev mailing alias.
- Login or register to post comments
- Printer-friendly version
- vivekp's blog
- 1421 reads





