f-angi
6/28/2016 - 12:50 PM

CXF client to upload a file invoking a REST service (http://wwwdev.arag.it/webservices/sinistri/allega/?id_ds=83817&categoria=pippo)

CXF client to upload a file invoking a REST service (http://wwwdev.arag.it/webservices/sinistri/allega/?id_ds=83817&categoria=pippo)

	<jaxrs-client:client id="allegatiUploadClient"
		address="${rs-allegati-upload.host}" username="${rs-allegati-upload.username}"
		password="${rs-allegati-upload.password}"
		serviceClass="it.intesys.arag.portlet.denuncia.service.impl.AllegatiUploadClient"
		inheritHeaders="true">
		<jaxrs-client:headers>
			<entry key="Accept" value="application/json" />
		</jaxrs-client:headers>
		<jaxrs-client:providers>
			<ref bean="jsonProvider" />
		</jaxrs-client:providers>
	</jaxrs-client:client>
public interface AllegatiUploadClient {    
    @POST
    @Path("/webservices/sinistri/allega/")
    @Consumes("multipart/form-data")
    @Produces(MediaType.APPLICATION_JSON)
    AllegatiUploadServiceResult upload(@Multipart Attachment allegato, 
      @QueryParam(value = "categoria") String categoria, 
      @QueryParam(value = "id_ds") String idDenuncia);
}