public bool _download_SaldosCotistasD0() { try { br.com.itaucustodia.www.DownloadArquivos.DownloadArquivoServiceService cliente = new br.com.itaucustodia.www.DownloadArquivos.DownloadArquivoServiceService(); //string resp = cliente.saldosCotaAberturaD0XML("gradual.op53", "1s22s22p", "990686"); string resp = cliente.saldosCotaAberturaD0XML(_ebusiness, _senha, _codgestor); byte[] zipbytes = Convert.FromBase64String(resp); ZipFile zip = ZipFile.Read(zipbytes); zip.ExtractAll(_dirArquivosRecebidos, ExtractExistingFileAction.OverwriteSilently); zip.Dispose(); return(true); } catch (Exception ex) { logger.Error("_download_SaldosCotistasD0(): " + ex.Message, ex); } return(false); }
private void button1_Click(object sender, EventArgs e) { try { br.com.itaucustodia.www.DownloadArquivos.DownloadArquivoServiceService cliente = new br.com.itaucustodia.www.DownloadArquivos.DownloadArquivoServiceService(); //cliente.Credentials = new NetworkCredential("gradual.op53", "1s22s22p6"); string resp = cliente.saldosCotaAberturaD0XML("gradual.op53", "1s22s22p", "990686"); //string resp = cliente.saldosCotaAberturaD0XMLNoZIP("gradual.op53", "1s22s22p", "990686"); //resp = resp.Replace("<![CDATA[ ", ""); //resp = resp.Replace(" ]]>", ""); byte[] zipbytes = Convert.FromBase64String(resp); ZipFile zip = ZipFile.Read(zipbytes); zip.ExtractAll("c:\\temp\\itaufj\\recebidos", ExtractExistingFileAction.OverwriteSilently); //ParserXMLSaldosAberturaD0 pser = new ParserXMLSaldosAberturaD0(); //pser.Parse(resp); //br.com.itaucustodia.www.PosicaoGerencial.PosicaoGerencialServiceService geren = new br.com.itaucustodia.www.PosicaoGerencial.PosicaoGerencialServiceService(); //br.com.itaucustodia.www.PosicaoGerencial.SituacaoCotistaBean[] cotistas = geren.consultarSituacaoCotistas("gradual.op53", "1s22s22p", "990686"); //string cotistas = geren.consultarSituacaoCotistasXML("gradual.op53", "1s22s22p", "990686"); } catch (Exception ex) { } }