Example #1
0
        private void SOAPTimer_Tick(object sender, EventArgs e)
        {
            SOAPTimer.Stop(); // Stop SOAP TIMER

            if (_Internal_NonceCodeToCheck.Length > 0)
            {
                try
                {
                    OpenAntumIDSOAP.AntumIDserverPortTypeClient SOAPClient = new OpenAntumIDSOAP.AntumIDserverPortTypeClient();
                    OpenAntumIDSOAP.Message SOAPMessage = new OpenAntumIDSOAP.Message();
                    SOAPMessage.AuthenticationRequestType         = "action_validate_auth_openantumid|MyFirstApplication";
                    SOAPMessage.AuthenticationRequestReturnType   = "";
                    SOAPMessage.AuthenticationRequestReturnFields = "";
                    SOAPMessage.AuthenticationRequestGUID         = _AntumID_API_Application_Token;
                    SOAPMessage.AuthenticationRequestClientIP     = "0.0.0.0";
                    SOAPMessage.AuthenticationValidateTokenID     = _Internal_NonceCodeToCheck;
                    ResponseOpenAntumID MyResponse             = new ResponseOpenAntumID();
                    System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(MyResponse.GetType());
                    System.IO.Stream stream = new System.IO.MemoryStream(Encoding.UTF8.GetBytes(SOAPClient.sendMessage(SOAPMessage)));
                    MyResponse = (ResponseOpenAntumID)ser.Deserialize(stream);

                    switch (MyResponse.RESPONSE)
                    {
                    case "":
                        SOAPTimer.Start();
                        break;

                    case "ERR-200":
                        MessageBox.Show("OK, Connected, Use and store this Open AntumID Encrypted Public DigiID Key: " + MyResponse.DIGIID.ToString());
                        this.Close();
                        break;

                    case "ERR-503":
                        this.Close();
                        break;

                    case "ERR-404":
                        this.Close();
                        break;

                    case "ERR-500":
                        this.Close();
                        break;

                    default:
                        SOAPTimer.Start();
                        break;
                    }
                }

                catch (Exception ex) {
                    System.Diagnostics.Debug.WriteLine(ex.Message.ToString());
                }
            }
            else
            {
            }
        }
        private void SOAPTimer_Tick(object sender, EventArgs e)
        {
            SOAPTimer.Stop(); // Stop SOAP TIMER

            if (_Internal_NonceCodeToCheck.Length > 0)
            {
                try
                {
                    OpenAntumIDSOAP.AntumIDserverPortTypeClient SOAPClient = new OpenAntumIDSOAP.AntumIDserverPortTypeClient();
                    OpenAntumIDSOAP.Message SOAPMessage = new OpenAntumIDSOAP.Message();
                    SOAPMessage.AuthenticationRequestType         = "action_validate_auth|MyFirstApplication"; // Pre-Register AntumID -> DigiID Result = idem of Open AntumID
                    SOAPMessage.AuthenticationRequestReturnFields = "*";                                       //Get all personal information

                    // SOAPMessage.AuthenticationRequestReturnFields = "FIRSTNAME|"; //Get single item
                    // SOAPMessage.AuthenticationRequestReturnFields = "FIRSTNAME|LASTNAME|"; //Get two or more items

                    // ReturnFields that can be used in this property

                    /*
                     * FIRSTNAME
                     * LASTNAME
                     * BIRTHDAY
                     * BIRTHPLACE
                     * NATIONALITY
                     * ADDRESS
                     * CITY
                     * POSTAL
                     * GENDER
                     * AGE
                     * LASTUPDATE
                     * EIDVALIDFROM
                     * EIDVALIDUNTIL
                     * EMAIL
                     */


                    SOAPMessage.AuthenticationRequestReturnType = "";
                    SOAPMessage.AuthenticationRequestGUID       = _AntumID_API_Application_Token;
                    SOAPMessage.AuthenticationRequestClientIP   = "0.0.0.0";
                    SOAPMessage.AuthenticationValidateTokenID   = _Internal_NonceCodeToCheck;
                    ResponseOpenAntumID MyResponse             = new ResponseOpenAntumID();
                    System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(MyResponse.GetType());
                    System.IO.Stream stream = new System.IO.MemoryStream(Encoding.UTF8.GetBytes(SOAPClient.sendMessage(SOAPMessage)));
                    MyResponse = (ResponseOpenAntumID)ser.Deserialize(stream);

                    switch (MyResponse.RESPONSE)
                    {
                    case "":
                        SOAPTimer.Start();
                        break;

                    case "ERR-200":
                        Internal_ShowMyResultDialog(MyResponse);
                        this.Close();
                        break;

                    case "ERR-503":
                        this.Close();
                        break;

                    case "ERR-404":
                        this.Close();
                        break;

                    case "ERR-500":
                        this.Close();
                        break;

                    default:
                        SOAPTimer.Start();
                        break;
                    }
                }

                catch (Exception ex) {
                    System.Diagnostics.Debug.WriteLine(ex.Message.ToString());
                }
            }
            else
            {
            }
        }