Um binäre Dateien, wie etwa Bilder, über einen Webservice zu senden oder empfangen, kann man sie in ein ByteArray konvertieren.
public byte[] createByteArray(string imageName)
{
   FileInfo fileInfo = new FileInfo(imageName);
   FileStream fileStream = fileInfo.OpenRead();
   byte[] byteArray = new byte[fileStream.Length];
   int bytesRead = fileStream.Read(byteArray, 0, fileStream.Length);
   Console.WriteLine("{0} bytes have been read from {1}",
   bytesRead.ToString(), imageName);
   return byteArray;
}

In die andere Richtung:

public void saveAsImage(byte[] bytes, string imageName)
{
   MemoryStream memStream = new MemoryStream(bytes);
   System.Drawing.Image image =
   System.Drawing.Image.FromStream(memStream);
   image.Save(imageName);
   Console.WriteLine("{0} was created successfully.", imageName);
}