Web Service runs but consuming method gives error

-1

I've struggled to set up my web service in IIS. It goes up, showing the screen that WS is ok. It turns out that when I pass a parameter to it it gives this error:

REQUEST ERROR
The server encountered an error processing the request. See server logs for more details.

IIS is on an AMAZON (Cloud) server.

My method

public TPDV getCnpjParceiro(string cnpj)
        {
            V99_WEBEntities db = new V99_WEBEntities();
            TPDV pdv = new TPDV();
            List<string> lista = new List<string>();

            var resultado = (from _lista in db.T_PDV
                             where _lista.CNPJ == cnpj
                             join _st in db.T_CRM_StatusPDV on _lista.CNPJ equals(_st.DE_Cnpj)
                             join _sc in db.T_Script on _st.IT_Status equals((int)_sc.TipoStatus)
                             select new
                             {
                                 _lista.CNPJ,
                                 _lista.RazaoSocial,
                                 _lista.Endereco,
                                 _lista.CaminhoLogo,
                                 _lista.Bairro,
                                 _lista.Cidade,
                                 _st.IT_Status,
                                 _st.DT_TransacaoV,
                                 tecnico = _sc.TipoScript == "T" ? _sc.Script : null,
                                 central = _sc.TipoScript == "C" ? _sc.Script : null
                             }).ToList();

            foreach (var lis in resultado)
            {
                pdv.CNPJ = lis.CNPJ;
                pdv.RazaoSocial = lis.RazaoSocial;
                pdv.Endereco = lis.Endereco;
                pdv.CaminhoLogo = lis.CaminhoLogo;
                pdv.Bairro = lis.Bairro;
                pdv.Cidade = lis.Cidade;
                pdv.ScriptCentral = lis.central;
                pdv.ScriptTecnico = lis.tecnico;
            }

            return pdv;

        }

I pass the parameter like this:

meu_ip/WebServiceSuporteTecnico/SuporteTecnicoServiceWS.svc/pesquisa/um_cnpj_da_minha_base
    
asked by anonymous 23.05.2014 / 01:40

1 answer

0

I resolved. The error was as follows: When I uploaded the files to IIS that is on a remote machine on Amazon, I also submitted my web.config. The database I'm using is on the same machine. Talking to the guy who manages Amazon here at the company, he told me that IP is not a real IP, it's a masked IP that points to real IP so the outside world does not know the real IP. As he was trying to access the bank through this IP, he could not get out, because it's just a fictitious IP and he was giving this stick. When I opened the server's Event Viewer and saw the database's underlying open () error, I could see that it was a problem with the connection and that was what was giving the error. Well, I got the IP of the web.config and changed everything to localhost, because the bank and the iis are in the same physical environment, so the DB is in localhost. I did this and it's working now.

    
23.05.2014 / 16:26