示例#1
0
        public bool realizarPeticion()
        {
            ZSolcarteraCliente  lcliente      = null;
            ZSolcartera         lenviar       = null;
            ZSolcarteraResponse lws_respuesta = null;
            bool lres = false;

            try
            {
                lcliente = new ZSolcarteraCliente(Solcartera.EndpointName);
                lenviar  = new ZSolcartera();
                this._respuesta.update(false, 1, "Inicio de la solicitud a SAP");

                lcliente.ClientCredentials.UserName.UserName           = Solcartera.User;
                lcliente.ClientCredentials.UserName.Password           = Solcartera.Pass;
                lcliente.ChannelFactory.Credentials.SupportInteractive = false;

                /*Enviar sin datos*/
                lenviar.T_SOLCARTERA = new ZSolcartera_solicitud[1];
                lenviar.T_DETSOLCART = new ZSolcartera_detalle[1];

                /*Datos a enviar*/
                lenviar.T_ENT_SOLCARTERA = this._catSolicitudes.ToArray();;
                lenviar.T_ENT_DETSOLCART = this._catDetalleSolicitud.ToArray();

                lws_respuesta = lcliente.ZCMLMF_SOLCARTERA(lenviar);

                _respuesta.catRespuesta = lws_respuesta;

                if (lws_respuesta != null && lws_respuesta.ERROR == 1)
                {
                    Solcartera.dbgErr("WsSolcartera Error == 1");
                    lres = false;
                    this.updateStatus(lres, 1, "Solicitud no procesada, error == 1");
                }
                else
                {
                    lres = true;
                    this.updateStatus(lres, 0, "Esta hecha exitosamente la solicitud a SAP");
                }
            }
            catch (Exception aexception)
            {
                lres = false;
                this.updateStatus(lres, 1, "Anomalia-realizarSolicitud: " + aexception.Message);
            }
            return(lres);
        }
示例#2
0
        public static string testc()
        {
            string lres = "";

            try
            {
                ZSolcarteraCliente lcliente = new ZSolcarteraCliente(Solcartera.EndpointName);

                lcliente.ClientCredentials.UserName.UserName           = Solcartera.User;
                lcliente.ClientCredentials.UserName.Password           = Solcartera.Pass;
                lcliente.ChannelFactory.Credentials.SupportInteractive = false;

                ZSolcartera lenviar = new ZSolcartera();

                /*Enviar sin datos*/
                lenviar.T_SOLCARTERA = new ZSolcartera_solicitud[1];
                lenviar.T_DETSOLCART = new ZSolcartera_detalle[1];

                /*Datos a enviar*/
                ZSolcartera_solicitud lsol = new ZSolcartera_solicitud();
                ZSolcartera_detalle   ldet = new ZSolcartera_detalle();
                lenviar.T_ENT_DETSOLCART = new ZSolcartera_detalle[] { ldet };
                lenviar.T_ENT_SOLCARTERA = new ZSolcartera_solicitud[] { lsol };

                ZSolcarteraResponse lrespuesta = lcliente.ZCMLMF_SOLCARTERA(lenviar);

                if (lrespuesta.ERROR == 1)
                {
                    lres = "Solcartera Error == 1";
                    Solcartera.dbgErr("WsSolcartera Error == 1");
                }
                else
                {
                    lres = "Esta hecho con exito la solicitud";
                }
            }
            catch (Exception aexception)
            {
                lres = "Exc:" + aexception.Message;
                System.Diagnostics.Debug.WriteLine("Tetc.Exception: " + aexception.Message);
            }
            return(lres);
        }