|
From: Raphael S. <rap...@gm...> - 2013-11-05 13:41:10
|
Hi!
I am trying to use ResteasyClient to call a multipart rest service.
This is the class defining my form.
public class FileUploadForm {
public FileUploadForm() {
}
private byte[] data;
public byte[] getData() {
return data;
}
@FormParam("uploadedFile")
@PartType("application/octet-stream")
public void setData(final byte[] data) {
this.data = data;
}
}
The service is defined as following:
@POST
@Consumes("multipart/form-data")
public Response uploadFile(@MultipartForm final FileUploadForm form) {
...
}
I created an interface to use with ResteasyClient:
@POST
@Consumes("multipart/form-data")
public Response uploadFile(final FileUploadForm form);
I'm invoking the service like this:
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(url);
this.proxy = target.proxy(ProcessoResourceInterface.class);
this.proxy.uploadFile(new FileUploadForm());
I'm getting the following error:
javax.ws.rs.ProcessingException: could not find writer for content-type
multipart/form-data type: br.com.conam.workflow.rest.FileUploadForm
I'm using the following versions:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.4.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>2.3.6.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-multipart-provider</artifactId>
<version>2.3.6.Final</version>
</dependency>
Am I missing something?
Thanks in advance for the help!
|