arkadaşlar aşağıda gelen sonucu (XMLPOST) nasıl tabloya aktarırım ?
teşekkürler
Kod: Tümünü seç
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,ADODB,IdHTTP, AppEvnts,
MSXML, ComObj, ActiveX, Grids, DBGrids, MSXML2_TLB, DB;
type
TForm1 = class(TForm)
DBGrid1: TDBGrid;
ds1: TDataSource;
qryMSXML2_TLB: TADOQuery;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
IdHTTP1: TIdHTTP;
donxml:String;
xml,topla_gel:WideString;
Form1: TForm1;
implementation
function XMLPOST(url,postdata:String):String;
var
GonderilecekVeri:TStrings;
DonecekSonuc:TStringStream;
XmlString,aa:string;
IdHTTP1:TIdHTTP;
begin
try
try
try
GonderilecekVeri := TStringList.Create;
GonderilecekVeri.Text:=postdata;
XmlString:='';
DonecekSonuc := TStringStream.Create('');
IdHTTP1:=TIdHTTP.Create(nil);
IdHTTP1.HTTPOptions:=[];
IdHTTP1.ReadTimeout:=30000;
IdHTTP1.Disconnect;
IdHTTP1.Post(url,GonderilecekVeri,DonecekSonuc);
IdHTTP1.Disconnect;
XmlString:=DonecekSonuc.DataString;
result:=XmlString;
except on e:exception do
begin
// mesajpost('logyaz','xmlpost hata '+e.Message);
end;
end;
finally
begin
DonecekSonuc.Free;
GonderilecekVeri.Free;
IdHTTP1.Disconnect;
FreeAndNil(IdHTTP1);
end;
end;
except
end;
end;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
xml:='<?xml version=''1.0''?>'+
'<mainbody>'+
'<header>'+
'<company>NETGSM</company>'+
'<usercode>xxxxxx</usercode>'+
'<password>xxxxx</password>'+
'<startdate>050120150101</startdate>'+
'<stopdate>050220150101</stopdate>'+
'</header>'+
'</mainbody>';
donxml:='';
donxml:=XMLPOST('http://api.netgsm.com.tr/xmlgelenfax.asp',xml);
showmessage(donxml);
end;
end.