You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Hardeep Singh <ha...@pelco.com> on 2011/02/09 19:24:24 UTC

Enable MTOM for a specific method

Hi,

Is it possible to enabled MTOM for only a specific method in the Web
Service?

I am using this way to enable MTOM.

        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        Map<String, Object> mtomProperty = new HashMap<String, Object>();
        mtomProperty.put("mtom-enabled", Boolean.TRUE);
        factory.setProperties(mtomProperty);

This enables it for all the methods, changes the content-type, adds message
boundaries etc. Please let me know if this cannot be done.

Thanks
Hardeep Singh


This transmission is intended only for use by the intended
recipient(s). If you are not an intended recipient you should not read, disclose copy, circulate or in any other way use the information contained in this transmission. The information contained in this transmission may be confidential and/or privileged. If you have received this transmission in error, please notify the sender immediately and delete this transmission including any attachments.

Re: Enable MTOM for a specific method

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 09 February 2011 1:24:24 pm Hardeep Singh wrote:
> Hi,
> 
> Is it possible to enabled MTOM for only a specific method in the Web
> Service?
> 
> I am using this way to enable MTOM.
> 
>         JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
>         Map<String, Object> mtomProperty = new HashMap<String, Object>();
>         mtomProperty.put("mtom-enabled", Boolean.TRUE);
>         factory.setProperties(mtomProperty);
> 
> This enables it for all the methods, changes the content-type, adds message
> boundaries etc. Please let me know if this cannot be done.

The only way this could be done would be to add an interceptor at the very 
start of the OUT chain that would look at the operation and set the "mtom-
enabled", Boolean.TRUE flag on the message just like above.   



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog