Entegratör (Firma ve Devlet arasındaki iş/işlemleri düzenleyen) firmalar https://ebelge.gib.gov.tr/efaturaozelentegratorlerlistesi.html adresinde yayınlanmaktadır. Yazılımcı ile GİB arasındaki FİRMA dır. Test hesap ve portal ları ile manuel olarak E-Fatura vs olaylarını inceleyebilirsiniz. Kodlama aşamasında oldukça ÖNEMLİ bir yeri vardır. Bu makalede Adana Hızlı Bilişim Teknolojileri.A.Ş.’ne ait https://www.hizliteknoloji.com.tr/Home/Referans ALT YAPI larını kullanarak uygulamamızı gerçekleştireceğiz. Kısaca bundan sonra adı ENTEGRATÖR olarak geçecektir. Uygulamamız iki ana kısımdan oluşacaktır. GİDEN ve GELEN faturalar. Entegratörün Web servislerini kullanacağız
HizliService.pas : Entegratör servisi için kullanılan prosüdür ve fonksiyonları barındıran DELPHI dosyası.
Servis Adı https://econnecttest.hizliteknoloji.com.tr/Services/HizliService.svc
Kullanıcı Adı hizli
Şifre rWBDkoA6
Test Vergi No 4620553774 (Vergi No kısaca VKN diye söyleniyor)
Mail defaultgb@hizlibilisimteknolojileri.net (Yazılım sahibinin mail adresi)
Fatura No yapısı: Özel bir yapısı vardır. On altı karakterli olmalıdır. Örnek fatura no PRM2020000000017. ÖN EK üç karakterli olmalıdır (PRM gibi). Sonra dört karakterli 2020 YIL ile devam eder. Kalan 9 karakter ise fatura SIRA NO dur. Bu sıra no veritabanı tarafından verilmeli ve benzersiz olmalıdır.
HTTPRIO1 Bileşeni: Entegratöre gönderilen XML yapılarını yönetir. Gelen CEVAP bilgisini de bu bileşen yönetir.
VirtualTable1 Bileşeni: Gelen veya Giden Faturaların SORGU sonuçları için kullanılır. Tipleri aşağıdadır. UniDAC
DBGrid Bileşeni: VirtualTable ile alınan bilgileri göstermek için kullanılır. Uygulamanın TASARIM görüntüsü.
Kodlarımızın tamamı aşağıdadır.
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, ShellApi, Vcl.ComCtrls,
Data.DB, MemDS, VirtualTable, Vcl.Grids, Vcl.DBGrids, Vcl.Menus,
Soap.Rio, Soap.SOAPHTTPClient, Soap.InvokeRegistry, System.Net.URLClient, HizliService, XSBuiltIns;
type
TForm1 = class(TForm)
Label1: TLabel;
Panel1: TPanel;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
Edit2: TEdit;
Label4: TLabel;
Edit3: TEdit;
HTTPRIO1: THTTPRIO;
MemoLog: TMemo;
Panel2: TPanel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
Panel3: TPanel;
ComboBox4: TComboBox;
DateTimePicker1: TDateTimePicker;
DateTimePicker2: TDateTimePicker;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Button1: TButton;
Button3: TButton;
Button4: TButton;
Label8: TLabel;
Button2: TButton;
VirtualTable1: TVirtualTable;
VirtualTable1AppType: TStringField;
VirtualTable1DocumentCurrency: TStringField;
VirtualTable1DocumentId: TStringField;
VirtualTable1DocumentTypeCode: TStringField;
VirtualTable1EnvelopeExp: TStringField;
VirtualTable1EnvelopeStatus: TStringField;
VirtualTable1EnvelopeUUID: TStringField;
VirtualTable1IsAccount: TBooleanField;
VirtualTable1IsArchive: TBooleanField;
VirtualTable1IsInternetSale: TBooleanField;
VirtualTable1IsPrinted: TBooleanField;
VirtualTable1IsRead: TBooleanField;
VirtualTable1IsTransferred: TBooleanField;
VirtualTable1LocalReferenceId: TStringField;
VirtualTable1Message: TStringField;
VirtualTable1PayableAmount: TStringField;
VirtualTable1ProfileId: TStringField;
VirtualTable1SendType: TStringField;
VirtualTable1Status: TStringField;
VirtualTable1StatusExp: TStringField;
VirtualTable1TargetAlias: TStringField;
VirtualTable1TargetIdentifier: TStringField;
VirtualTable1TargetTitle: TStringField;
VirtualTable1TaxTotal: TStringField;
VirtualTable1UUID: TStringField;
VirtualTable1CancelDate: TDateTimeField;
VirtualTable1CreateDate: TDateTimeField;
VirtualTable1IssueDate: TDateTimeField;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure HTTPRIO1AfterExecute(const MethodName: string; SOAPResponse: TStream);
procedure LogEkle(Str1: String);
procedure HTTPRIO1BeforeExecute(const MethodName: string; SOAPRequest: TStream);
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Servis: IHizliService;
Cevap: DocumentList2;
AppType, I: Integer;
StartDate: TXSDateTime;
EndDate: TXSDateTime;
TarihTipi: String;
begin
MemoLog.Lines.Clear;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.UserName := Edit2.Text;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.Password := Edit3.Text;
Servis := GetIHizliService(False, Edit1.Text, HTTPRIO1);
if RadioButton1.Checked then
TarihTipi := 'CreatedDate'
else if RadioButton2.Checked then
TarihTipi := 'IssueDate';
StartDate := TXSDateTime.Create;
EndDate := TXSDateTime.Create;
StartDate.AsDateTime := DateTimePicker1.DateTime;
EndDate.AsDateTime := DateTimePicker2.DateTime;
Cevap := Servis.GetDocumentList(ComboBox4.ItemIndex + 1, TarihTipi, StartDate, EndDate, False, False,
False, 'ALL');
VirtualTable1.Close;
VirtualTable1.Clear;
VirtualTable1.Open;
I := 0;
TRY
While length(Cevap.documents[I].DocumentId) <> 0 do
begin
VirtualTable1.Append;
VirtualTable1AppType.AsInteger := Cevap.documents[I].AppType;
// VirtualTable1CancelDate.AsDateTime := Cevap.documents[I].CancelDate.AsDateTime;
VirtualTable1CreateDate.AsDateTime := Cevap.documents[I].CreatedDate.AsDateTime;
VirtualTable1DocumentCurrency.AsString := Cevap.documents[I].DocumentCurrencyCode;
VirtualTable1DocumentId.AsString := Cevap.documents[I].DocumentId;
VirtualTable1DocumentTypeCode.AsString := Cevap.documents[I].DocumentTypeCode;
VirtualTable1EnvelopeExp.AsString := Cevap.documents[I].EnvelopeExp;
VirtualTable1EnvelopeStatus.AsInteger := Cevap.documents[I].EnvelopeStatus;
VirtualTable1EnvelopeUUID.AsString := Cevap.documents[I].UUID;
VirtualTable1IsAccount.AsBoolean := Cevap.documents[I].IsAccount;
VirtualTable1IsArchive.AsBoolean := Cevap.documents[I].IsAccount;
VirtualTable1IsInternetSale.AsBoolean := Cevap.documents[I].IsInternetSale;
VirtualTable1IsPrinted.AsBoolean := Cevap.documents[I].IsPrinted;
VirtualTable1IsRead.AsBoolean := Cevap.documents[I].IsRead;
VirtualTable1IsTransferred.AsBoolean := Cevap.documents[I].IsTransferred;
VirtualTable1IssueDate.AsDateTime := Cevap.documents[I].IssueDate.AsDate;
VirtualTable1LocalReferenceId.AsString := Cevap.documents[I].LocalReferenceId;
VirtualTable1Message.AsString := Cevap.documents[I].Messsage;
VirtualTable1ProfileId.AsString := Cevap.documents[I].ProfileID;
VirtualTable1SendType.AsString := Cevap.documents[I].SendType;
VirtualTable1Status.AsInteger := Cevap.documents[I].Status;
VirtualTable1TargetAlias.AsString := Cevap.documents[I].TargetAlias;
VirtualTable1TargetIdentifier.AsString := Cevap.documents[I].TargetIdentifier;
VirtualTable1TargetTitle.AsString := Cevap.documents[I].TargetTitle;
VirtualTable1PayableAmount.AsString := Cevap.documents[I].PayableAmount.DecimalString;
VirtualTable1TaxTotal.AsString := Cevap.documents[I].TaxTotal.DecimalString;
VirtualTable1UUID.AsString := Cevap.documents[I].UUID;
VirtualTable1.Post;
Inc(I);
end;
EXCEPT
END;
VirtualTable1.Cancel;
VirtualTable1.First;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
Servis: IHizliService;
Giris: ArrayOfInputInvoiceModel;
Cevap: ArrayOfOutputInvoiceModel;
Sayac: Integer;
Irsaliye: ArrayOfDespatchs;
FaturaKalem: ArrayOfInvoiceLine;
KalemVergi: ArrayOfLineTax;
LineExtensionAmount: TXSDecimal;
AllowanceTotalAmount: TXSDecimal;
TaxInclusiveAmount: TXSDecimal;
PayableAmount: TXSDecimal;
CalculationRate: TXSDecimal;
Quantity_Amount: TXSDecimal;
Price_Amount: TXSDecimal;
Allowance_Percent: TXSDecimal;
Allowance_Amount: TXSDecimal;
Price_Total: TXSDecimal;
Tax_Base: TXSDecimal;
Tax_Perc: TXSDecimal;
Tax_Amnt: TXSDecimal;
AppType, I: Integer;
GUIDList: ArrayOfstring;
Uid: TGuid;
ETTN: String;
begin
try
MemoLog.Lines.Clear;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.UserName := Edit2.Text;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.Password := Edit3.Text;
Servis := GetIHizliService(False, Edit1.Text, HTTPRIO1);
SetLength(Giris, 1);
Giris[0] := InputInvoiceModel2.Create;
if ComboBox1.ItemIndex = 0 then
Giris[0].AppType := 1 // 1 efatura
else
Giris[0].AppType := 3; // 3 earşivfatura
Giris[0].DestinationIdentifier := '4620553774';
Giris[0].DestinationUrn := 'urn:mail:' + 'mehmetguverdik@gmail.com';
Giris[0].SourceUrn := 'urn:mail:' + 'defaultgb@hizlibilisimteknolojileri.net';
Giris[0].IsDraft := False;
Giris[0].IsDraftSend := False;
Giris[0].LocalId := '';
Giris[0].UpdateDocument := False;
Giris[0].InvoiceModel := InvoiceModel2.Create;
Giris[0].InvoiceModel.invoiceheader := InvoiceHeader2.Create;
CreateGuid(Uid);
ETTN := GuidToString(Uid);
ETTN := StringReplace(ETTN, '{', '', [rfReplaceAll]);
ETTN := StringReplace(ETTN, '}', '', [rfReplaceAll]);
Giris[0].InvoiceModel.invoiceheader.UUID := ETTN;
Giris[0].InvoiceModel.invoiceheader.Invoice_ID := 'PRM' + '2020' + FormatFloat('000000000', random(1000));
Giris[0].InvoiceModel.invoiceheader.IssueDate := FormatDateTime('yyyy-mm-dd', DateTimePicker1.DateTime);
Giris[0].InvoiceModel.invoiceheader.IssueTime := FormatDateTime('yyyy-mm-dd hh:mm:ss',
DateTimePicker1.DateTime);
Giris[0].InvoiceModel.invoiceheader.ProfileID := ComboBox2.Text;
Giris[0].InvoiceModel.invoiceheader.InvoiceTypeCode := ComboBox3.Text;
Giris[0].InvoiceModel.invoiceheader.DocumentCurrencyCode := 'TRY';
// **** FATURA ALT TOPLAM ******************
LineExtensionAmount := TXSDecimal.Create;
LineExtensionAmount.AsBcd := 5169.49; // Tutar
AllowanceTotalAmount := TXSDecimal.Create;
AllowanceTotalAmount.AsBcd := 2203.39; // İskonto toplam
TaxInclusiveAmount := TXSDecimal.Create;
TaxInclusiveAmount.AsBcd := 5169.49; // Vergi Dahil Tutar
PayableAmount := TXSDecimal.Create;
PayableAmount.AsBcd := 3500; // Ödenecek tutar
// ******************************************************************************************
CalculationRate := TXSDecimal.Create;
CalculationRate.AsBcd := 1; // kur TL için çarpan..
Giris[0].InvoiceModel.invoiceheader.LineExtensionAmount := LineExtensionAmount; // Tutar
Giris[0].InvoiceModel.invoiceheader.AllowanceTotalAmount := AllowanceTotalAmount; // iskonto toplamı
Giris[0].InvoiceModel.invoiceheader.TaxInclusiveAmount := TaxInclusiveAmount; // vergi dahil tutar
Giris[0].InvoiceModel.invoiceheader.PayableAmount := PayableAmount; // Ödenecek tutar
Giris[0].InvoiceModel.invoiceheader.CalculationRate := CalculationRate; // döviz kuru
Giris[0].InvoiceModel.invoiceheader.Note := 'Fatura AÇIKLAMA Bilgisi';
Giris[0].InvoiceModel.invoiceheader.OrderReferenceId := 'İrsaliye No 001';
Giris[0].InvoiceModel.invoiceheader.OrderReferenceDate :=
FormatDateTime('yyyy-mm-dd', DateTimePicker1.DateTime); // İrsaliye Tarih..
Giris[0].InvoiceModel.customer := Customer2.Create;
Giris[0].InvoiceModel.customer.IdentificationID := '4620553774'; // Vergi No = VKN ..
Giris[0].InvoiceModel.customer.PartyName := 'Firma Adı MEHMET GÜVERDİK';
Giris[0].InvoiceModel.customer.TaxSchemeName := 'Vergi Daire SEYHAN';
Giris[0].InvoiceModel.customer.CountryName := 'Ülke TÜRKİYE';
Giris[0].InvoiceModel.customer.CityName := 'ADANA';
Giris[0].InvoiceModel.customer.CitySubdivisionName := 'SEYHAN';
Giris[0].InvoiceModel.customer.StreetName := 'Adres SEYHAN - ADANA';
Giris[0].InvoiceModel.customer.ElectronicMail := 'mehmetguverdik@gmail.com';
Giris[0].InvoiceModel.customer.WebsiteURI := 'www.guverdik.com';
Giris[0].InvoiceModel.customer.Telefax := '+90 5XX XXX XX XX';
Giris[0].InvoiceModel.customer.Telephone := '+90 5XX XXX XX XX';
Giris[0].InvoiceModel.customer.Person_FirstName := 'MEHMET';
Giris[0].InvoiceModel.customer.Person_FamilyName := 'GÜVERDİK';
SetLength(Irsaliye, 1);
Irsaliye[0] := Despatchs.Create;
Irsaliye[0].DespatchDocumentID := 'İrsaliye No 001'; // İrsaliye Tarih..
Irsaliye[0].DespatchDocumentIssueDate := FormatDateTime('yyyy-mm-dd', DateTimePicker1.DateTime);
Giris[0].InvoiceModel.Despatchs := Irsaliye;
// **** FATURA KALEMLERİ *********************************************
SetLength(FaturaKalem, 2); // Fatura Kalemi 2 ADET olduğu için ..
// *******************************************************************************************************
// 1.SATIR FATURA KALEMİ ***********
Quantity_Amount := TXSDecimal.Create;
Quantity_Amount.AsBcd := 1; // MIKTAR ..
Price_Amount := TXSDecimal.Create;
Price_Amount.AsBcd := 2966.102; // TUTAR ..
Allowance_Percent := TXSDecimal.Create;
Allowance_Percent.AsBcd := 42.62; // İSKONTO YUZDE ..
Allowance_Amount := TXSDecimal.Create;
Allowance_Amount.AsBcd := 1264.24; // ISKONTO TUTAR ..
Price_Total := TXSDecimal.Create;
Price_Total.AsBcd := 2008.20; // TOPLAM ..
Tax_Base := TXSDecimal.Create;
Tax_Base.AsBcd := 2966.102 - 1264.24; // TUTAR - ISKONTO_TUTAR ..
Tax_Perc := TXSDecimal.Create;
Tax_Perc.AsBcd := 18; // KDV YUZDE ..
Tax_Amnt := TXSDecimal.Create;
Tax_Amnt.AsBcd := 306.34; // KDV TUTAR ..
SetLength(KalemVergi, 1); // Satırda ikinci bir VERGI varsa. O Zaman 2 ..
KalemVergi[0] := LineTax.Create;
KalemVergi[0].Tax_Code := '0015'; // VERGI KODU, 2. Vergi ÖRNEK ÖTV = 9015 ..
KalemVergi[0].Tax_Name := 'KDV'; // VERGI ADI ..
KalemVergi[0].Tax_Base := Tax_Base; // VERGI MATRAH ..
KalemVergi[0].Tax_Perc := Tax_Perc; // VERGI ORAN ..
KalemVergi[0].Tax_Amnt := Tax_Amnt; // VERGI TUTAR ..
KalemVergi[0].Tax_Exem_Code := ''; // istisna kodu KDV TUTARI 0 ise doldurulmaz
KalemVergi[0].Tax_Exem := ''; // istisna açıklması KDV TUTARI 0 ise doldurulmalı
FaturaKalem[0] := InvoiceLine.Create;
FaturaKalem[0].ID := 1; // FATURA KALEM SATIR NO ..
FaturaKalem[0].Item_Name := 'FLOPPY DISK';
FaturaKalem[0].Quantity_Amount := Quantity_Amount; // miktar
FaturaKalem[0].Price_Amount := Price_Amount; // fiyat
FaturaKalem[0].Quantity_Unit_User := 'C62'; // birim AC62 = ADET ..
FaturaKalem[0].Allowance_Percent := Allowance_Percent; // iskonto oranı
FaturaKalem[0].Allowance_Amount := Allowance_Amount; // iskonto tutarı
FaturaKalem[0].Price_Total := Price_Total; // toplam tutar
FaturaKalem[0].lineTaxes := KalemVergi;
// 1.SATIR FATURA KALEMİ SONU ***********
// *******************************************************************************************************
// *******************************************************************************************************
// 2.SATIR FATURA KALEMİ ***********
Quantity_Amount := TXSDecimal.Create;
Quantity_Amount.AsBcd := 1; // MIKTAR ..
Price_Amount := TXSDecimal.Create;
Price_Amount.AsBcd := 2203.39; // TUTAR ..
Allowance_Percent := TXSDecimal.Create;
Allowance_Percent.AsBcd := 42.62; // İSKONTO YUZDE ..
Allowance_Amount := TXSDecimal.Create;
Allowance_Amount.AsBcd := 939.15; // ISKONTO TUTAR ..
Price_Total := TXSDecimal.Create;
Price_Total.AsBcd := 1491.80; // TOPLAM ..
Tax_Base := TXSDecimal.Create;
Tax_Base.AsBcd := 2203.39 - 939.15; // TUTAR - ISKONTO_TUTAR ..
Tax_Perc := TXSDecimal.Create;
Tax_Perc.AsBcd := 18; // KDV YUZDE ..
Tax_Amnt := TXSDecimal.Create;
Tax_Amnt.AsBcd := 227.56; // KDV TUTAR ..
SetLength(KalemVergi, 1); // Satırda ikinci bir VERGI varsa. O Zaman 2 ..
KalemVergi[0] := LineTax.Create;
KalemVergi[0].Tax_Code := '0015'; // VERGI KODU, 2. Vergi ÖRNEK ÖTV = 9015 ..
KalemVergi[0].Tax_Name := 'KDV'; // VERGI ADI ..
KalemVergi[0].Tax_Base := Tax_Base; // VERGI MATRAH ..
KalemVergi[0].Tax_Perc := Tax_Perc; // VERGI ORAN ..
KalemVergi[0].Tax_Amnt := Tax_Amnt; // VERGI TUTAR ..
KalemVergi[0].Tax_Exem_Code := ''; // istisna kodu KDV TUTARI 0 ise doldurulmaz
KalemVergi[0].Tax_Exem := ''; // istisna açıklması KDV TUTARI 0 ise doldurulmalı
FaturaKalem[1] := InvoiceLine.Create;
FaturaKalem[1].ID := 1; // FATURA KALEM SATIR NO ..
FaturaKalem[1].Item_Name := 'HARD DISK';
FaturaKalem[1].Quantity_Amount := Quantity_Amount; // miktar
FaturaKalem[1].Price_Amount := Price_Amount; // fiyat
FaturaKalem[1].Quantity_Unit_User := 'C62'; // birim AC62 = ADET ..
FaturaKalem[1].Allowance_Percent := Allowance_Percent; // iskonto oranı
FaturaKalem[1].Allowance_Amount := Allowance_Amount; // iskonto tutarı
FaturaKalem[1].Price_Total := Price_Total; // toplam tutar
FaturaKalem[1].lineTaxes := KalemVergi;
// 2.SATIR FATURA KALEMİ SONU ***********
// *******************************************************************************************************
Giris[0].InvoiceModel.invoiceLines := FaturaKalem;
Cevap := Servis.SendInvoiceModel(Giris);
ShowMessage(Cevap[0].Message_);
AppType := 3; // e Arşiv ..
SetLength(GUIDList, 1);
GUIDList[0] := ETTN; // '00AA0586-5437-48DF-941C-D6DECCBDC8EE';
finally
for Sayac := 0 to length(Giris) - 1 do
Giris[Sayac].Free;
for Sayac := 0 to length(Cevap) - 1 do
Cevap[Sayac].Free;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
Servis: IHizliService;
Cevap: DocumentContent2;
ETTN: String;
dosyayaz: TFileStream;
begin
MemoLog.Lines.Clear;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.UserName := Edit2.Text;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.Password := Edit3.Text;
Servis := GetIHizliService(False, Edit1.Text, HTTPRIO1);
ETTN := VirtualTable1UUID.AsString;
Cevap := Servis.GetDocumentFile(ComboBox4.ItemIndex + 1, ETTN, 'PDF', False);
if Cevap.IsSucceeded then
begin
dosyayaz := TFileStream.Create(ExtractFilePath(Application.ExeName) + ETTN + '.' + 'PDF', fmCreate);
dosyayaz.Write(Cevap.DocumentFile, length(Cevap.DocumentFile));
dosyayaz.Free;
ShellExecute(Handle, 'open', PWideChar(ExtractFilePath(Application.ExeName) + ETTN + '.' + 'PDF'), nil,
nil, SW_SHOWNORMAL);
end else begin
ShowMessage('Baaşrısız');
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
var
Servis: IHizliService;
Cevap: DocumentContent2;
ETTN: String;
dosyayaz: TFileStream;
begin
MemoLog.Lines.Clear;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.UserName := Edit2.Text;
HTTPRIO1.HTTPWebNode.GetHTTPReqResp.Password := Edit3.Text;
Servis := GetIHizliService(False, Edit1.Text, HTTPRIO1);
ETTN := VirtualTable1UUID.AsString;
Cevap := Servis.GetDocumentFile(ComboBox4.ItemIndex + 1, ETTN, 'XML', False);
if Cevap.IsSucceeded then
begin
dosyayaz := TFileStream.Create(ExtractFilePath(Application.ExeName) + ETTN + '.' + 'XML', fmCreate);
dosyayaz.Write(Cevap.DocumentFile, length(Cevap.DocumentFile));
dosyayaz.Free;
ShellExecute(Handle, 'open', PWideChar(ExtractFilePath(Application.ExeName) + ETTN + '.' + 'XML'), nil,
nil, SW_SHOWNORMAL);
end else begin
ShowMessage('Baaşrısız');
end;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = VK_ESCAPE then
Close;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
DateTimePicker1.Date := Now - 5;
DateTimePicker2.Date := Now;
end;
procedure TForm1.HTTPRIO1AfterExecute(const MethodName: string; SOAPResponse: TStream);
var
Str: string;
Sl: TStringList;
begin
Sl := TStringList.Create;
try
SOAPResponse.Seek(0, soFromBeginning);
Sl.LoadFromStream(SOAPResponse);
Str := Sl.Text;
finally
FreeAndNil(Sl);
end;
LogEkle('CEVAP OLARAK GELEN XML KODLARI' + #13#10#13#10 + Str + #13#10);
end;
procedure TForm1.HTTPRIO1BeforeExecute(const MethodName: string; SOAPRequest: TStream);
var
StrList1: TStringList;
begin
inherited;
StrList1 := TStringList.Create;
try
SOAPRequest.Position := 0;
StrList1.LoadFromStream(SOAPRequest);
LogEkle('GÖNDERİLECEK XML KODLARI' + #13#10#13#10 + StringReplace(StrList1.Text, '><', '>' + #13#10 + '<',
[rfReplaceAll]) + #13#10);
finally
StrList1.Free;
end;
end;
procedure TForm1.LogEkle(Str1: String);
begin
MemoLog.Lines.Add(FormatDateTime('hh:nn:ss', Now) + ' ' + Str1);
end;
end.
Test Portal adres : http://portaltest.hizliteknoloji.com.tr/accounting/login yukarıdaki kullanıcı adı ve şifre girilir