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 Tue, 12 Oct 2010 03:07:05 GMT
On Monday 11 October 2010 4:57:37 pm Benson Margulies wrote:
> On Mon, Oct 11, 2010 at 1:35 PM, Daniel Kulp <dkulp@apache.org> wrote:
> > 
> > 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. 

Or Aegis could call message.getContextualProperty(..) to match what the 
AttachmentOutInterceptor does.   Or Aegis could call 
service.getEndpointInfo().getBinding().get(MTOM_ENABLED) so it's in one place.  
or. ....    Bunches of options.   Pick one.  :-)

> It should be easy enough to
> make JAX-WS add that property to the ServiceImpl; is there any reason
> not to? 

Well,it's not as easy as you think.   Something like:

<jaxws:endpoint  ......>
   <jaxws:properties>
        <entry key="mtom-enabled" value="true"/>
...

should also work, but that just sets the properties on the EndpointInfo, which 
isn't the ServiceImpl OR the Binding.   That's why the getContextualProperty  
call is valuable.  

> And also stick the threshold out there so Aegis could learn to
> use it?

Hold on....  are we talking READING or WRITING?

Those are two very different situations.  For READING, we shouldn't require a 
setting anywhere.   If the message comes in in MIME format, it should just 
turn itself on automatically.  The incoming side may not have any control over 
what the other end of the wire sends.   If they send in MTOM, we should just 
accept it.

For WRITING, the databinding really needs to use the same method that the 
AttachmentOutInterceptor uses.   If AttachmentOut doesn't detect that it 
should be MTOM, then the databinding really shouldn't try as the wire won't be 
setup for it.   (no mime wrappers)




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

Mime
View raw message