Asp de Tc Kimlik No ile Veri Gösteme

'Programlama' forumunda sha. tarafından 1 Ara 2009 tarihinde açılan konu

Konu etiketleri:
  1. sha.

    sha. ..daha çirkin, daha huysuz

    <%

    Dim TCKimlikNo
    TCKimlikNo = 111111111111 // KİMLİK NUMARAMIZI BURAYA YAZIYORUZ

    Function XMLWebservices(byVal KimlikNo)
    Dim SOAP
    SOAP = "<?xml version=""1.0"" encoding=""utf-8""?>"&_
    "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"&_
    "<soap:Body>"&_
    "<TCKimlikNoDogrula xmlns=""http://kps.nvi.gov.tr/WS/Public"">"&_
    "<tcKimlikNo>"& KimlikNo &"</tcKimlikNo>"&_
    "</TCKimlikNoDogrula>"&_
    "</soap:Body>"&_
    "</soap:Envelope>"

    Set objWebServices = Server.CreateObject("Msxml2.ServerXMLHTTP")
    objWebServices.Open "POST" "http://tckimlik.nvi.gov.tr/kpspublic.asmx" false
    objWebServices.setRequestHeader "Content-Type" "text/xml; charset=utf-8"
    objWebServices.setRequestHeader "soapAction" "http://kps.nvi.gov.tr/WS/Public/TCKimlikNoDogrula"
    objWebServices.Send(SOAP)

    Dim Text
    If objWebServices.readyState = 4 Then
    If objWebServices.Status = 200 Then
    Text = objWebServices.responseText
    End If
    End If

    Set objWebServices = Nothing

    XMLWebservices = Text
    End Function

    Dim Sonuc
    Sonuc = Trim(XMLWebservices(TCKimlikNo))

    If (Len(Sonuc) <> 0) Then

    Set objXML = Server.CreateObject("Microsoft.XMLDOM")
    objXML.async = False
    objXML.loadxml(Sonuc)
    Set objNODE = objXML.selectSingleNode("soap:Envelope/soap:Body/TCKimlikNoDogrulaResponse/TCKimlikNoDogrulaResult")
    Response.Write "<b>Kimlik No :</b> "& objNode.childNodes.item(0).Text &"<br /><br />"& vbCrlf
    Response.Write "<b>Isim :</b> "& objNode.childNodes.item(1).Text &"<br /><br />"& vbCrlf
    Response.Write "<b>Soyad :</b> "& objNode.childNodes.item(2).Text &"<br /><br />"& vbCrlf
    Response.Write "<b>Doğum Tarihi :</b> "& objNode.childNodes.item(3).Text &"<br />"& vbCrlf

    Set objNODE = Nothing
    Set objXML = Nothing

    Else
    Response.Write "Girdiğiniz Bilgi Doğrulanamadı!"
    End If
    %>
     

Bu Sayfayı Paylaş