To send an image to a webservices, should I encode it to Base64? [closed]

1

I would like to know if to send the image from java I must first encode it.

    
asked by JDeveloper 01.08.2016 в 17:50
source

2 answers

0

I think you are referring to how to send the byte array of an image in a Web Service, to send it, having the byte array, as you mention you have to code it to Base64 in this way:

String miImagen = Base64.encodeToString(byteArray, Base64.DEFAULT);

miImagen would be the value you would send in the WebService.

    
answered by 01.08.2016 / 23:01
source
0

You can use MTOM (from Java 6) JAX-WS MTOM , or as a string in base 64, as Elenasys says.

    
answered by 01.08.2016 в 23:20