Ir para conteúdo
Fórum Script Brasil
  • 0

web service


fdefod

Pergunta

olá pessoal,

Estou desenvolvendo um aplicativo que compara arquivo de duas maquinas(Local e remota). Na máquina remota eu rodo uma web service que gera um hash do arquivo e me retorna uma string. na local eu tb gero um hash e comparo com o que foi retornado da maq. remota.

O prblema é que a quantida de arquivos é muito grande. e quando eu coloco pra rodar dá o seguinte erro:

An existing connection was forcibly closed by the remote host

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Aguem sabe dizer como resolver isso??

Codigo que chama webservice!

for (int i = 0; i < array.Count; i++)  //20.000 arquivos +-
                {
                       WebReference.Service obj = new WebReference.Service();
                   
                    row = dtSample.NewRow();
                    string arquivo = array[i].ToString();
                    string lisboa= HttpUtility.UrlDecode(obj.DownloadFile(arquivo));
                    obj.Dispose();
                    if (txtExtensao.Text.Equals(String.Empty))
                    {
                        //    if (arquivo[arquivo.Length - 4].Equals('.') )
                        //       row["TIPO"] = arquivo.Substring(arquivo.LastIndexOf(".") + 1);
                        //   else
                        //        row["TIPO"] = "pasta";

                        for (int j = 0; j < intelig.Count; j++)
                        {
                            if (arquivo.Equals(intelig[j].ToString())&&Comparar(arquivo,lisboa)==true)
                            {
                                if (rblStatus.Items[1].Selected || rblStatus.Items[2].Selected)
                                {
                                    row["ARQUIVO EM LISBOA"] = array[i].ToString();
                                    row["INTELIG"] = "ok";
                                    dtSample.Rows.Add(row);
                                }
                                break;
                            }
                            else if (j == intelig.Count - 1)
                            {
                                if (rblStatus.Items[0].Selected || rblStatus.Items[2].Selected)
                                {
                                    row["ARQUIVO EM LISBOA"] = array[i].ToString();
                                    row["INTELIG"] = "falha";
                                    dtSample.Rows.Add(row);
                                }
                            }

                        }
                    }

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...