Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 45149 invoked from network); 14 Mar 2011 15:33:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Mar 2011 15:33:54 -0000 Received: (qmail 38687 invoked by uid 500); 14 Mar 2011 15:33:54 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 38666 invoked by uid 500); 14 Mar 2011 15:33:54 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 38658 invoked by uid 99); 14 Mar 2011 15:33:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 15:33:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 15:33:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8F2A03A8C39 for ; Mon, 14 Mar 2011 15:33:29 +0000 (UTC) Date: Mon, 14 Mar 2011 15:33:29 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: <2043736416.994.1300116809583.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <845780377.842.1300113749603.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (CXF-3399) When using ResponseBuilder to create Response of multiparts, the boundary attribute in the Content-Type Header is missing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-3399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006464#comment-13006464 ] Sergey Beryozkin commented on CXF-3399: --------------------------------------- Hi I think I know what it is. Can you just avoid setting the content type on the ResponseBuilder ? Please do: return Response.ok().entity(multipartBody).build(); I've done a quick test which confirms the top-level Content-Type includes the boundary when Response is returned and no content type is set explicitly. Otherwise whatever ContentType the user sets on the ResponseBuilder has to be used... Can you please verify it ? thanks, Sergey > When using ResponseBuilder to create Response of multiparts, the boundary attribute in the Content-Type Header is missing > ------------------------------------------------------------------------------------------------------------------------- > > Key: CXF-3399 > URL: https://issues.apache.org/jira/browse/CXF-3399 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.3.3 > Environment: XP 2002 SP-3, JDK 1.6.0.17, cxf-2.3.3, > Reporter: Avshalom Yeshurun > Labels: Boundary, Content-Type, ResponseBuilder > Original Estimate: 672h > Remaining Estimate: 672h > > Hello, > We have implemented the following method while the output of the Response should be a multipart message. > @POST > @Path("{destinationAddress}/messages/payloads") > @Consumes("application/xml") > @Produces({"multipart/related", "multipart/mixed", "multipart/form-data"}) > public Response postMailboxMessagesPayloadRequest(@Context HttpServletRequest request, > @PathParam("destinationAddress") String destinationAddress, > @Context ServletContext servletContext, > JAXBElement jAXBElement) { > try{ > List attachments = ((MultipartBody)mwMailboxMessagesPayloadResponse.getBody()).getAllAttachments(); > MultipartBody multipartBody = new MultipartBody(attachments); > ResponseBuilder responseBuilder = Response.status(HttpURLConnection.HTTP_OK); > responseBuilder.type(multipartBody.getType() > responseBuilder.entity(multipartBody); > Response response = responseBuilder.build(); > return response; > } > catch(Exception e){ > } > The thing is that no matter what we do, we can not have the 'boundary' which is determined by the CXF engine to appear in the Content-Type on the main header. > As a result no Client will be able to parse the returned message. > If we try to manually set the Content-Type header while giving it our own 'boundary', the result is that a different boundary is generated for the actual message, while the boundary we set is not the same. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira