Just a quick note: We really need to have these attached as patches to JIRA with the "grant to apache" box checked. That (more or less) makes sure we have the legal right to use the code as well as makes sure the issue is tracked.
Thanks! Dan On Saturday 22 May 2010 12:25:25 am Loh Kok Jeng wrote: > I forgot to mention that I'm using CXF 2.2.5. > > Below are the changes I made to solve the problem: > > apache-cxf-2.2.5\rt\core\src\main\java\org\apache\cxf\attachment\Attachment > Impl.java > > 59c59,60 > < headers.put(name.toLowerCase(), value); > --- > > > //headers.put(name.toLowerCase(), value); > > headers.put(name, value); > > apache-cxf-2.2.5\rt\frontend\jaxrs\src\main\java\org\apache\cxf\jaxrs\ext\M > essageContextImpl.java > > 146,147c146,147 > < Attachment handler = (Attachment)handlers.get(i); > < AttachmentImpl att = new > AttachmentImpl(handler.getContentId(), handler.getDataHandler()); > --- > > > Attachment handler = (Attachment)handlers.get(i); > > AttachmentImpl att = new > > AttachmentImpl(handler.getContentId(), > > handler.getDataHandler()); > > 148,149c149,150 > < att.setHeader(key, att.getHeader(key)); > --- > > > att.setHeader(key, handler.getHeader(key)); > > regards, > Loh Kok Jeng > > On 22 May 2010 04:55, Sergey Beryozkin <[email protected]> wrote: > > Hi > > > > Hi > > > > I'm pretty sure it is the same issue I've just talked about in the other > > email which I also believe has just been fixed... > > > > GetMessage param = new GetMessage(); > > > >> try { > >> param.setMessageRefIdentifier(messageIdentifier); > >> attach = receiveclient.getMessage(param, > >> credentials); > > > > At this moment of time you have the attachments received with headers in > > lower-case > > > >> if (attach.hasNext()) { > >> while (attach.hasNext()) { > >> MultivaluedMap<String, String> > >> map = new MetadataMap<String, String>(); > >> AttachmentPartImpl impl = > >> attach.next(); > >> > >> Iterator<MimeHeader> itor = > >> impl.getAllMimeHeaders(); > >> while (itor.hasNext()) { > >> MimeHeader mimeHdr = > >> (MimeHeader) itor.next(); > >> > >> map.add(mimeHdr.getName(), mimeHdr.getValue()); > >> } > > > > As suggested in the other email I can only think of the following > > workaround unless you can try 2.2.9-SNAPSHOT : get headers using > > well-known keys and set them using the same well-known keys (Content-ID, > > Content-Location, etc) hope it helps, Sergey > > > >> } > >> > >> regards, > >> KJLoh -- Daniel Kulp [email protected] http://dankulp.com/blog
