public static void SerializeWSRecords(string filename)
 {
     var dipWS = new GISA.IntGestDoc.Controllers.DocInPortoWS();
     Stream stream = File.Open(filename, FileMode.Create);
     var diags = dipWS.GetDocumentosEnviadosParaArquivoGeral(DateTime.MinValue, int.MaxValue);
     BinaryFormatter bFormatter = new BinaryFormatter();
     bFormatter.Serialize(stream, diags.ToArray());
     stream.Close();
 }