Hi, i have problems to put a image inside a list to send a petiton in a remoting ro server.
— C# is working well ----
ServerAccess server = new ServerAcess();
List<AppImage> list = new List<AppImage();
AppImage obj = new AppImage();
byte[] imagen = File.ReadAllBytes(@"C:\imagenes\example.png");
obj.Image = imagen;
var result = server.Service1.SaveList(list);
– Android Java Problem —
imagenPedido.setTipoImagenPedidoID(1);
imagenPedido.setPedidoID(1);
VariantType data = new VariantType();
byte[] img = AlbumActivity.listaImagenes.get(i).getImagen();
data.setAsData(img);
imagenPedido.setImagen(data);
listaImagen.addItem(imagenPedido);
Error = java.lang.Exception: BinMessage : Unknown or unsupported variant type code
---- Objetive C ------
func guardarImagenes() {
let objeto = AppImagenPedido()
let lista = TAppImagenPedido()
let sesion = AppLogin()
let rovariant = ROVariant()
rovariant.asData = Datos.fotos[0].imagen as NSData
objeto.pedidoID = 1
objeto.tipoImagenPedidoID = 1
objeto.imagen = rovariant
lista?.add(objeto)
let respuesta = server.guardarFotos(lista!, sesion)
if (respuesta.Valida) {
print(“Correcto”)
}else{
print(“Error”)
}
}
Error = Error String “Unknown or unsupported type code 8209 found in variant stream”
Which exactly error did you get? Binary is nothing more than a wrapper around MemoryStream, so anything that would work for MemoryStream would also work for Binary as well.
As for the original issue - could you show how exactly the server method is defined (both in RODL and in code)? What is the server platform (.NET or Delphi)?
Also could you point where exactly in the Java code you do perform a call to the server?