I have the following problem:
I need to pass some files (xmls and pdf) from my winforms application to a webservice.
The problem is that you can not pass via parameters to a WS data type such as List < >.
In this case, I'm going to make it past the array containing the bytes of the file, so I can render it on the server inside WS.
I'm having trouble sending and receiving this list through a list.
// Cada arquivo eu insiro em um List<byte[]>, exemplo:
listaDeBytes.Add(File.ReadAllBytes(arrayAnexos[x]));
In this case, I have in my list 3 records with their respective bytes inside. To make this list an array, do the following:
// Transformando a List<byte[]> em uma array de byte:
byte[] listaEmByte = listaDeBytes.SelectMany(a => a).ToArray();
At this point, he inserted the 3 records with their bytes in this array, but it seems to have put everything together. The problem is how to interpret this list that I receive in my WS. How to turn it back into a list of bytes so I can read it.
I tried to convert it to a byte [] [], but it is not possible to convert the list to byte [] [] through SelectMany.
Any help is welcome. Thank you.