cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject Re: Dug myself into a pit switching from Simple to JAX-WS
Date Mon, 11 Oct 2010 20:57:37 GMT
On Mon, Oct 11, 2010 at 1:35 PM, Daniel Kulp <dkulp@apache.org> wrote:
>
> 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.

It is absolutely not enough for Aegis. In Aegis, the interceptor won't
find anything to do unless the DataHandlerType has set up the
attachment. The DataHandlerType won't setup any attachments unless the
mtom flag is set in the Aegis context, and that flag won't be set
unless the ServiceImpl had the MTOM_ENABLED property ... which it
lacks with JAX-WS but has with Simple. It should be easy enough to
make JAX-WS add that property to the ServiceImpl; is there any reason
not to? And also stick the threshold out there so Aegis could learn to
use it?

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