I use android annotations to communicate with the server. In one of the api calls I need to send some text data and an image, say, from gallery.
String addItem(Protocol protocol);
Just use the right Spring converter : FormHttpMessageConverter.
If you really want to use any object as parameter, you have to implement your own custom
FormHttpMessageConverter which will handle that by using reflection.