Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 19673 invoked from network); 23 Jan 2007 16:58:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jan 2007 16:58:03 -0000 Received: (qmail 40701 invoked by uid 500); 23 Jan 2007 16:58:09 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 40553 invoked by uid 500); 23 Jan 2007 16:58:08 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 40544 invoked by uid 99); 23 Jan 2007 16:58:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 08:58:08 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [66.249.82.238] (HELO wx-out-0506.google.com) (66.249.82.238) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 08:57:59 -0800 Received: by wx-out-0506.google.com with SMTP id i26so1702315wxd for ; Tue, 23 Jan 2007 08:57:38 -0800 (PST) Received: by 10.90.90.16 with SMTP id n16mr8268430agb.1169571458330; Tue, 23 Jan 2007 08:57:38 -0800 (PST) Received: by 10.90.63.13 with HTTP; Tue, 23 Jan 2007 08:57:37 -0800 (PST) Message-ID: <7b774c950701230857o2ed953c0ofdf745a39f63387@mail.gmail.com> Date: Tue, 23 Jan 2007 11:57:37 -0500 From: "Dan Diephouse" To: cxf-dev@incubator.apache.org Subject: Re: MIME support in XML binding In-Reply-To: <008301c73f0e$00bf0840$c301020a@sberyoz> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_190186_9834520.1169571457984" References: <7b774c950701100716u3848f6ckf5142230face2ea8@mail.gmail.com> <008301c734d1$90cc3620$3901020a@sberyoz> <7b774c950701121247q719e86e3m2410854713b168e5@mail.gmail.com> <002401c73e50$a4ff2980$c301020a@sberyoz> <7b774c950701221146he528281s263f80d8839ca298@mail.gmail.com> <008301c73f0e$00bf0840$c301020a@sberyoz> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_190186_9834520.1169571457984 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm fine with just throwing everything in the Map for now. We can create a LazyAttachmentMap later - having the functionality is most important part at this point :-) A JIRA for the LazyAttachmentMap would be great too. Thanks, - Dan On 1/23/07, Sergey Beryozkin wrote: > > Hi > > I suppose we can have a unmodifyable Map > implementation using Collection internally for > iterating/queries. I guess the only performance benefit we can get with it > is that the provider's invoke() can be hit without caching in all the > attachemnats first...But this I think is important when a provider can > proceed with handling the invocation without reading all the attachments it > may need first which may not always be possible... > > If you reckon it's a worthy idea (creating LazyAttachmentMap) then I can > create a JIRA specifically to address the performance issue resulting from > the fact that creating a HashMap will lead to all > attachments be read through the LazyAttachmentCollection and then perhaps > look into it later, as at the moment I need to create a basic patch to > ensure attachements gets delivered to XMLBinding providers... > > Thanks, Sergey > > > >I think that JAX-WS specifies that it be typed as Map > > not Collection. The key in the map would be the Content-ID. > So > > we would have to convert. > > > > This kills performance as it requires us to cache all the attachments > > (unlike JAXB where we can lazily load do to some hackish code :-)), but > > there isn't much I can do about that. > > > > - Dan > > > > On 1/22/07, Sergey Beryozkin wrote: > >> > >> Hi > >> > >> Thanks for a hint. So I've added an AttachmentInInterceptor to the list > of > >> in-interceptors in the XMLBindingFactory. > >> As far as I can see after looking through the code the side-effect of > this > >> addition is that an implementation of org.apache.cxf.message.Messagewill > >> have a Collection set on it by the AttachmentDeserializer. > >> > >> Now the next problem to solve is how to make this collection visible to > >> Provider implementations as they only see a > >> javax.xml.ws.handler.MessageContext. I can see > >> org.apache.cxf.jaxws.support.ContextPropertiesMapping, and it's there > >> where a MessageContext is created, in createWebServiceContext(Exchange > >> exchange). > >> > >> So in this method I've just added > >> > >> ctx.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, > >> exchange.getInMessage().getAttachments()); > >> > >> so that the incoming attachments if any can be visible to Provider > impls. > >> > >> I reckon that's all I need. Any comments/corrections would be > >> appreciated... > >> > >> Thanks, Sergey > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> ----- Original Message ----- > >> From: "Dan Diephouse" > >> To: > >> Sent: Friday, January 12, 2007 8:47 PM > >> Subject: Re: MIME support in XML binding > >> > >> > >> > It shouldn't be too hard to support MIME with the XML binding. I > added > >> in > >> > the attachment interceptors to the HTTP binding so I've already > gotten > >> MIME > >> > over HTTP with no SOAP working. I think the main thing it requires is > >> adding > >> > the interceptors to the XMLBindingFactory. > >> > > >> > >> > > > > > > -- > > Dan Diephouse > > Envoi Solutions > > http://envoisolutions.com | http://netzooid.com/blog > > > -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog ------=_Part_190186_9834520.1169571457984--