Web Services

     
 

Upload big attachment (document) using CXF ( MTOM ) Spring and Tomcat


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].

 
 
 
 
Comments:

This is a very nice tutorial to start with web services. Thank You..

Posted by kiran on September 08, 2008 at 05:56 AM CDT #

Post a Comment:
  • HTML Syntax: Allowed
 

« January 2009
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today

Valid XHTML or CSS?

[This is a Roller site]
Theme by Rowell Sotto.
 
© Karthik