cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Dug myself into a pit switching from Simple to JAX-WS
Date Mon, 11 Oct 2010 17:35:50 GMT

Re-adding dev@.....

On Monday 11 October 2010 9:50:01 am Benson Margulies wrote:
> > Interesting.  Not sure how the databinding would have any affect on
> > wether MTOM is enabled or not.  The JAX-WS frontend should just be
> > setting the Message.MTOM_ENABLED property on the endpoint and the
> > AttachmentOutInterceptor picks that up and sets up the attachments.
> 
> It looks, superficially, as if JAX-WS is not setting that property
> where Aegis looks for it.
>
> I crossreferenced org.apache.cxf.message.Message.MTOM_ENABLED. I can
> see no connection to @MTOM. MTOM_ENABLED is turned on based on the
> 'deprecated?' binding ID in
> org.apache.cxf.jaxws.JaxWsClientFactoryBean.setBindingId(String).
> 
> That function sets the boolean in the config, and
> org.apache.cxf.binding.soap.SoapBindingFactory.createBindingInfo(ServiceInf
> o, String, Object) then sets MTOM_ENABLED.
> 
> Also JaxWsServiceFactoryBean maps @MTOM to the @MTOMFeature, but I
> can't find a trail connecting that to MTOM_ENABLED.

At some point in there (would need to debug through), I believe the JAX-WS 
SoapBinding thing (org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl) sets the 
property onto the BindingInfo.    From there, the AttachmentOutInterceptor 
queries that via a message.getContextualProperty(....).   That is enough for 
it to setup the MIME stuff and create the AttachmentSerializer object.   That 
SHOULD be all that is needed.    The places that call the 
databindings/datawriter write method will first call 
writer.setAttachments(...) if the MIME stuff is setup.    That's all the  
databinding should need to ENABLE MTOM.   The threshold thing is completely 
different.  I'm not even sure if that is working properly with JAXB.   Need to 
dig more.

Dan




> 
> 
> Threshold would require
> 
> > databinding support.
> 
> Well, right. Aegis looks for MTOM_ENABLED and respects it (creating
> attachments for certain data types) but does not look at
> MTOM_THRESHOLD at all.
> 
> > Strange.
> > Dan
> > 
> >> So, in trying to switch from Simple to JAX-WS, I removed the
> >> setting of the 'mtom-enabled' property, and turned it off altogether.
> >> That triggered the assymetry.
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog

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

Mime
View raw message