private void LoginAuthentication()
        {
            LogEvent            logEvent            = new LogEvent();
            TransactionProvider transactionProvider = new TransactionProvider();

            try
            {
                using (WsProd.B2BAIWebServiceDMZ wsB2B = new WsProd.B2BAIWebServiceDMZ())
                {
                    var User = transactionProvider.GetUser("SERA", "SERA", "B2BAITAG");
                    if (User != null)
                    {
                        var loginReq = new WsProd.LoginRequest();
                        loginReq.UserName  = User.UserCode;
                        loginReq.Password  = User.PassCode;
                        loginReq.ClientTag = User.ClientTag;

                        //WebProxy myProxy = new WebProxy(Resources.WebProxyAddress, true);
                        //myProxy.Credentials = new NetworkCredential(Resources.NetworkCredentialUserName, Resources.NetworkCredentialPassword, Resources.NetworkCredentialProxy);

                        //WebProxy myProxy = new WebProxy();
                        //myProxy.Credentials = new NetworkCredential(Resources.NetworkCredentialUserName, Resources.NetworkCredentialPassword, Resources.NetworkCredentialProxy);
                        //myProxy.Credentials = new NetworkCredential("backup", "serasibackup", "trac.astra.co.id");
                        //myProxy.Credentials = new NetworkCredential("rika009692", "mickey1988", "trac.astra.co.id");
                        //myProxy.Credentials = new NetworkCredential("genrpt", "serasera", "trac.astra.co.id");
                        //wsB2B.Proxy = myProxy;

                        var wsResult = wsB2B.LoginAuthentication(loginReq);
                        acknowledge = wsResult.Acknowledge;
                        ticketNo    = wsResult.TicketNo;
                        message     = wsResult.Message;
                    }

                    LblResult.Text      = "Service Result = ";
                    LblAcknowledge.Text = "Acknowledge : " + acknowledge;
                    LblTicketNo.Text    = "TicketNo : " + ticketNo;
                    LblMessage.Text     = "Message :" + message;

                    //logevent login succeded
                    logEvent.WriteDBLog("B2BAIWebServiceDMZ", "LoginAuthentication", acknowledge, ticketNo, message, fileType, "SERA");
                }
            }
            catch (Exception ex)
            {
                LblResult.Text      = ex.Message;
                LblAcknowledge.Text = "";
                LblTicketNo.Text    = "";
                LblMessage.Text     = "";

                //logevent login failed
                logEvent.WriteDBLog("B2BAIWebServiceDMZ", "LoginAuthentication", acknowledge, ticketNo, "webservice message : " + message + ". exception message : " + ex.Message, fileType, "SERA");

                Process.Start("taskkill.exe", "/f /im B2BAISERA_S02003.exe");
            }
        }
예제 #2
0
 /// <remarks/>
 public void LoginAuthenticationAsync(LoginRequest loginRequest)
 {
     this.LoginAuthenticationAsync(loginRequest, null);
 }