This is a continuation of the tutorial http://www.theasolutions.com/tutorials/cxfuploadattachment.jsp
Here let us tweak the code provided in the above tutorial to enable MTOM streaming capability at the client [client to the web service].
The modified section in Client.java is as below.
Map<String,Object> props = new HashMap<String, Object>();
props.put("mtom-enabled", Boolean.TRUE);
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setProperties(props);
factory.getInInterceptors().add(new LoggingInInterceptor());
Here we create a map which enables MTOM and set in the JaxWsproxyFactoryBean. [Hence the client will not try to include the entire file in the payload].
Posted by kiran on September 08, 2008 at 05:56 AM CDT #