Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 093AD200B66 for ; Thu, 18 Aug 2016 16:21:49 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0631A160AAE; Thu, 18 Aug 2016 14:21:49 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 49460160A76 for ; Thu, 18 Aug 2016 16:21:48 +0200 (CEST) Received: (qmail 3776 invoked by uid 500); 18 Aug 2016 14:21:47 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 3764 invoked by uid 99); 18 Aug 2016 14:21:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2016 14:21:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7F118C6811 for ; Thu, 18 Aug 2016 14:21:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.614 X-Spam-Level: * X-Spam-Status: No, score=1.614 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SORBS_WEB=0.614] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id K1shmbTduqbb for ; Thu, 18 Aug 2016 14:21:45 +0000 (UTC) Received: from vie01a-dmta-at51-2.mx.upcmail.net (vie01a-dmta-at51-2.mx.upcmail.net [62.179.121.140]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 403135FD12 for ; Thu, 18 Aug 2016 14:21:45 +0000 (UTC) Received: from [172.31.216.42] (helo=vie01a-pemc-psmtp-at51) by vie01a-dmta-at51.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1baOCO-0005HJ-Rr for users@cxf.apache.org; Thu, 18 Aug 2016 16:21:36 +0200 Received: from [192.168.2.103] ([77.235.187.34]) by vie01a-pemc-psmtp-at51 with SMTP @ mailcloud.upcmail.net id YeMc1t00j0kxsSt0BeMc43; Thu, 18 Aug 2016 16:21:36 +0200 X-SourceIP: 77.235.187.34 X-Authenticated-Sender: modsec@fwd.at X-CNFS-Analysis: v=2.2 cv=c/zpel1l c=1 sm=2 tr=0 a=QyrlR6gsbdOH+XX+xqQlxA==:117 a=QyrlR6gsbdOH+XX+xqQlxA==:17 a=IkcTkHD0fZMA:10 a=JsNJMmvks205GSivPQsA:9 Subject: Re: JAXRS How to define/use Multiparts with Json + xs:base64Binary To: users@cxf.apache.org References: <89fcf803-6fec-2978-31c6-d23c348d9687@fwd.at> From: "J. Fiala" Message-ID: <33129c34-5d0d-85b8-ebdb-d5cbc2cc110f@fwd.at> Date: Thu, 18 Aug 2016 16:21:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <89fcf803-6fec-2978-31c6-d23c348d9687@fwd.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit archived-at: Thu, 18 Aug 2016 14:21:49 -0000 p.s. a basic multipart like works, but then I only get the generic MultipartBody generated without any hint to the client how to assemble it correctly. Best regards, Johannes Am 18.08.2016 um 16:13 schrieb J. Fiala: > Hello, > > I defined a Multipart in the WADL (I'd like to use a multipart with > both json data + binary data): > > > > > type="xs:string" required="true"/> > element="mytypes:CreateMultipartRequestType"/> > > > element="xs:string"/> > > > > > > > type="mytypes:CreateRequestType" /> > xmime:expectedContentTypes="application/octet-stream"/> > > > > > > type="xs:string" /> > > > > > The generated Java code looks fine: > > @POST > @Consumes("application/json") > @Produces({"application/json" }) > @Path("/createMultipart") > String postCreateMultipart(@QueryParam("name") String name, > CreateRequestType createRequestType); > > public class CreateMultipartRequestType { > > @XmlElement(required = true) > @NotNull > @Valid > protected CreateRequestType requestModel; > @XmlElement(required = true) > @XmlMimeType("application/octet-stream") > @NotNull > protected DataHandler payload; > > } > > However, when I try to invoke the service using JacksonProvider, I get: > > WARNING: Interceptor for {http://myns/}MyResource has thrown > exception, unwinding now > org.apache.cxf.interceptor.Fault: No message body writer has been > found for class at.hello.CreateMultipartRequestType, ContentType: > application/json > > Any idea how I have to specify the Multipart in the WADL to get it > working? > > Best regards, > Johannes > > >