Merhaba,
Mobil için;
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : https://tckimlik.nvi.gov.tr/Service/KPSP....asmx?wsdl
// >Import : https://tckimlik.nvi.gov.tr/Service/KPSP...smx?wsdl>0
// Encoding : utf-8
// Version : 1.0
// (26.12.2019 10:42:32 - - $Rev: 96726 $)
// ************************************************************************ //
unit KPSPublicV2;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_OPTN = $0001;
IS_NLBL = $0004;
IS_REF = $0080;
type
// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Embarcadero types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:int - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:boolean - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:long - "http://www.w3.org/2001/XMLSchema"[Gbl]
// ************************************************************************ //
// Namespace : http://tckimlik.nvi.gov.tr/WS
// soapAction: http://tckimlik.nvi.gov.tr/WS/KisiVeCuzdanDogrula
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// use : literal
// binding : KPSPublicV2Soap
// service : KPSPublicV2
// port : KPSPublicV2Soap
// URL : https://tckimlik.nvi.gov.tr/Service/KPSPublicV2.asmx
// ************************************************************************ //
KPSPublicV2Soap = interface(IInvokable)
['{06D7DD71-6A70-E64F-84BD-87C71115D891}']
function KisiVeCuzdanDogrula(const TCKimlikNo: Int64; const Ad: string;
const Soyad: string; const SoyadYok: Boolean; const DogumGun: Integer;
const DogumGunYok: Boolean; const DogumAy: Integer;
const DogumAyYok: Boolean; const DogumYil: Integer;
const CuzdanSeri: string; const CuzdanNo: Integer;
const TCKKSeriNo: string): Boolean; stdcall;
end;
function GetKPSPublicV2Soap(UseWSDL: Boolean = System.False; Addr: string = '';
HTTPRIO: THTTPRIO = nil): KPSPublicV2Soap;
implementation
uses System.SysUtils;
function GetKPSPublicV2Soap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO)
: KPSPublicV2Soap;
const
defWSDL = 'https://tckimlik.nvi.gov.tr/Service/KPSPublicV2.asmx?wsdl';
defURL = 'https://tckimlik.nvi.gov.tr/Service/KPSPublicV2.asmx';
defSvc = 'KPSPublicV2';
defPrt = 'KPSPublicV2Soap';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as KPSPublicV2Soap);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end
else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
initialization
{ KPSPublicV2Soap }
InvRegistry.RegisterInterface(TypeInfo(KPSPublicV2Soap),
'http://tckimlik.nvi.gov.tr/WS', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(KPSPublicV2Soap),
'http://tckimlik.nvi.gov.tr/WS/KisiVeCuzdanDogrula');
InvRegistry.RegisterInvokeOptions(TypeInfo(KPSPublicV2Soap), ioDocument);
{ KPSPublicV2Soap.KisiVeCuzdanDogrula }
InvRegistry.RegisterMethodInfo(TypeInfo(KPSPublicV2Soap), 'KisiVeCuzdanDogrula',
'', '[ReturnName="KisiVeCuzdanDogrulaResult"]');
InvRegistry.RegisterParamInfo(TypeInfo(KPSPublicV2Soap), 'KisiVeCuzdanDogrula',
'DogumGun', '', '', IS_NLBL);
InvRegistry.RegisterParamInfo(TypeInfo(KPSPublicV2Soap), 'KisiVeCuzdanDogrula',
'DogumAy', '', '', IS_NLBL);
InvRegistry.RegisterParamInfo(TypeInfo(KPSPublicV2Soap), 'KisiVeCuzdanDogrula',
'CuzdanNo', '', '', IS_NLBL);
end.
Örnek kullanım:
procedure TForm1.Button1Click(Sender: TObject);
var
tc: KPSPublicV2Soap;
begin
try
tc := GetKPSPublicV2Soap(true);
if tc.KisiVeCuzdanDogrula(strtoInt64(Edit1.Text), Edit2.Text, Edit3.Text,
False, 0, False, 0, False, StrToInt(Edit4.Text), '', 0, '') = true then
Label1.Text := 'DOĞRU'
else
Label1.Text := 'YANLIŞ';
except
on E: Exception do
ShowMessage(E.ClassName + ' Hata, Detay : ' + E.Message);
end;
end;
Not: Örnek kullanım, @
elixir84 in kodundan örnek alınmıştır.