Exemplo n.º 1
0
        protected void validatePid(object sender, EventArgs e)
        {
            Session.Remove("CPRMATCH");
            Session.Remove("Text");
            Session.Remove("errorText");
            try
            {
                var cpr = RequestValidator.getValidatedParam("cpr", cprTxt.Text, 20);
                var pid = RequestValidator.getValidatedParam("pid", pidTxt.Text, 40);

                var wsUrl = Properties.Get("pid.service.url." + _spidEnv);
                PidService pidservice = new PidService(wsUrl);

                bool cprMatched = pidservice.Match(cpr, pid, SpidPid);
                Session.Add("CPRMATCH", cprMatched);
                if (cprMatched)
                {
                    Session.Add("Text", "Det lykkedes at matche CPR og PID.");
                }
                else
                {
                    Session.Add("errorText", "pid " + pid + " matcher ikke cpr " + cpr);
                }

                pidTxt.Text = HttpUtility.HtmlEncode(pid);
                cprTxt.Text = HttpUtility.HtmlEncode(cpr);
            }
            catch (PidServiceException ex)
            {
                Session.Add("errorText", ex.StatusStringDk);
            }
            catch (ArgumentException ae)
            {
                Session.Add("errorText", ae.Message);
            }
        }
Exemplo n.º 2
0
 static void Ping(string serviceUrl)
 {
     var wsClient = new PidService(serviceUrl);
     wsClient.Test();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Checks whether a connection can be made to the PID/CPR web service by means of calling 
 /// the test method on the web service
 /// </summary>
 /// <returns><code>true</code> if a connection can be made</returns>
 public static bool MakeTestConnectionToPidcprService(string pidWsUrl)
 {
     var serviceProviderClient = new PidService(pidWsUrl);
     serviceProviderClient.Test();
     return true;
 }