Hi,

how do I parameterize an interface method for a POST call that
consumes a multipart/form-data, for use with use
org.jboss.resteasy.client.ProxyFactory?

The server implements something like this:

@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Path("wherever")
public Response doFooImpl(MultipartFormDataInput object) {
List<InputPart> items = object.getFormDataMap().get("ITEM"); /* ... */
 }

In the client, I tried this:

@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Path("wherever")
Object doFoo(Map<String, DataSource> parts);

But when I run this, the client throws a

java.lang.RuntimeException: could not find writer for content-type
multipart/form-data type: java.util.Map

Would it be better to use a javax.mail.Multipart as a client-side
parameter? Or 
org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInputImpl
(if that is an "official" API class)?

Thanks, Jay

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to