unit DynamicRequestClientMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uRODynamicRequest, uROWinInetHttpChannel, uROClient, uROBINMessage, StdCtrls, uROPoweredByRemObjectsButton, uRORemoteService; type TDynamicRequestClientMainForm = class(TForm) DynamicRequestSum: TRODynamicRequest; bSum: TButton; bGetServerTime: TButton; EmptyDynamicRequest: TRODynamicRequest; bEchoPerson: TButton; DynamicRequestEchoPerson: TRODynamicRequest; ROWinInetHTTPChannel1: TROWinInetHTTPChannel; ROBinMessage1: TROBinMessage; ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; RemoteService: TRORemoteService; Memo: TMemo; procedure bSumClick(Sender: TObject); procedure bGetServerTimeClick(Sender: TObject); procedure bEchoPersonClick(Sender: TObject); private { Private declarations } procedure Log(str: string); public { Public declarations } end; var DynamicRequestClientMainForm: TDynamicRequestClientMainForm; implementation uses DynamicRequestLibrary_Intf; {$R *.dfm} procedure TDynamicRequestClientMainForm.bSumClick(Sender: TObject); begin with DynamicRequestSum do begin ParamByName('A').AsInteger := 1; ParamByName('B').AsInteger := 2; Log('Sum'); Log('--------'); Log('sending:' + #9 + ParamByName('A').AsString + ' ' + ParamByName('B').AsString); Execute; Log('received:' + #9 + ParamByName('result').AsString); Log(''); end; end; procedure TDynamicRequestClientMainForm.bGetServerTimeClick(Sender: TObject); begin with EmptyDynamicRequest do begin MethodName := 'GetServerTime'; Params.Refresh; Execute; Log('GetServerTime'); Log('------------------------'); Log('received:' + #9 + ParamByName('result').AsString); Log(''); end; end; procedure TDynamicRequestClientMainForm.bEchoPersonClick(Sender: TObject); var aperson, anotherperson: TPerson; begin aperson := TPerson.Create; with DynamicRequestEchoPerson do try aperson.FirstName := 'John'; aperson.LastName := 'Smith'; Log('EchoPerson'); Log('-------------------'); with aperson do Log('sending:' + #9 + Firstname + ' ' + LastName); ParamByName('aPerson').AsComplexType := aperson; Execute; anotherperson := ParamByName('anotherPerson').AsComplexType as TPerson; if Assigned(anotherperson) then try Log('received:' + #9 + anotherperson.Firstname + ' ' + anotherperson.LastName); finally FreeAndNIL(anotherperson); end; ParamByName('anotherPerson').AsComplexType := nil; Log(''); finally FreeAndNIL(aperson); end; end; procedure TDynamicRequestClientMainForm.Log(str: string); begin Memo.Lines.Add(str); end; end.