Take a photo and send it to a webserver with Android
I must send a photo taked from device an send it to a webservice

The remote method that receive the images has this form

    @Webservice(paramNames = {"id", "title", "fileBase64", "ext"}, description = "Add a receipt to the post.")
        public Response addReceipt(Integer id, String title, String fileBase64, String ext) throws Exception {
            User us = getUserLogged();
            PostService ps = new PostService();
            Post p = (Post) ps.read(idPost);
            if (us == null || !u.getUser().getId().equals(us.getId())) {
                return ErrorResponse.getIllegalOperationResponse(id, logger);
            }
            FileManager fm = new FileManager();
            String fileName = fm.saveReceipt(fileBase64, ext);
            PostReceipt pr = as.addReceipt(u, title, fileName);
            return new Response(new ReceiptJson(pr), null, id);
        }


So the problem is: 

-how to take a photo

-how to encode the photo as base 64 to put it in the Json

    {"id", "title", "fileBase64", "ext"}
 that I must send to described method:
Take a photo and send it to a webserver with Android
===

I must send a photo taked from device an send it to a webservice

The remote method that receive the images has this form

    @Webservice(paramNames = {"id", "title", "fileBase64", "ext"}, description = "Add a receipt to the post.")
        public Response addReceipt(Integer id, String title, String fileBase64, String ext) throws Exception {
            User us = getUserLogged();
            PostService ps = new PostService();
            Post p = (Post) ps.read(idPost);
            if (us == null || !u.getUser().getId().equals(us.getId())) {
                return ErrorResponse.getIllegalOperationResponse(id, logger);
            }
            FileManager fm = new FileManager();
            String fileName = fm.saveReceipt(fileBase64, ext);
            PostReceipt pr = as.addReceipt(u, title, fileName);
            return new Response(new ReceiptJson(pr), null, id);
        }


So the problem is: 

-how to take a photo

-how to encode the photo as base 64 to put it in the Json

    {"id", "title", "fileBase64", "ext"}
 that I must send to described method: