It SHOULD work.   I'd likely need to see an example.

That said, it can also depend on how the image is set in the JAXB object.   
Is it a byte[] or are you using DataHandler or Image or similar?   In order 
for the threshold to apply, it has to be a form where JAXB can actually 
determine the length without consuming a stream.     If you look in:

AttachmentUtil.createMtomAttachmentFromDH

you can see there is only a few types that we even try and compare the 
threshold when the type is a DataHandler.   You could try and add some more 
types there and submit a patch.   


Dan


On Friday, April 20, 2012 02:00:34 PM jaybytez wrote:
> I am using the latest JAXB and CXF 2.4.5 and am trying to test the
> mtom-threshold by sending an image via a web service.  It seems like no
> matter what I set the mtom-threshold too...it doesn't change whether the
> binary stream is added as an attachment or inline...it always adds as an
> attachment.
> 
> Here is my configuration, I have bumped the mtom-threshold to
> significantly large and small numbers and it makes no different for my
> 807 byte 1x1 pixel gif.
> 
> Is there something I need to change in the configuration to see
> mtom-threshold change how the stream is sent?
> 
>     <bean id="serviceProxyFactory"
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean" lazy-init="true">
>       <property name="serviceClass" value="com.foo.BusinessService"/>
>           <property name="address"
> value="${foo.url}/foo-svc-war/BusinessService"/>
>               <property name="properties">
>             <map>
>                  <entry key="mtom-enabled">
>                               <value type="java.lang.Boolean">true</value>
>                 </entry>
>                 <entry key="mtom-threshold" value="3000" />
>             </map>
>         </property>
>           <property name="inInterceptors" ref="logInbound"/>
>           <property name="outInterceptors">
>               <list>
>                   <ref bean="logOutbound"/>
>               </list>
>           </property>
>       </bean>
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Does-JaxWsProxyFactoryBean-JAXB-support-m
> tom-threshold-tp5655294p5655294.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to