unit COM_Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, uROPoweredByRemObjectsButton; type TCOM_MainForm = class(TForm) SumButton: TButton; TPersonButton: TButton; MultipleCallButton: TButton; ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; procedure SumButtonClick(Sender: TObject); procedure TPersonButtonClick(Sender: TObject); procedure MultipleCallButtonClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var COM_MainForm: TCOM_MainForm; implementation uses ComObj, ROCOM_TLB; {$R *.dfm} procedure TCOM_MainForm.SumButtonClick(Sender: TObject); var roserver, megademoservice: OleVariant; begin roserver := CreateOleObject('RemObjects.SDK.COMServer'); roserver.MessageType := 'BinMessage'; roserver.ChannelType := 'HTTP'; roserver.SetChannelProperty('TargetURL', 'http://localhost:8099/bin'); megademoservice := roserver.CreateService('MegaDemoService'); ShowMessage('The result is ' + VarToStr(megademoservice.Sum(1, 2))); end; procedure TCOM_MainForm.TPersonButtonClick(Sender: TObject); var roserver, megademoservice: OleVariant; person: OleVariant; begin roserver := CreateOleObject('RemObjects.SDK.COMServer'); roserver.MessageType := 'BinMessage'; roserver.ChannelType := 'HTTP'; roserver.SetChannelProperty('TargetURL', 'http://localhost:8099/bin'); person := roserver.CreateComplexType('TPerson'); person.FirstName := 'Peter'; person.LastName := 'Miller'; person.Age := 28; ShowMessage(person.FirstName + ' ' + person.LastName + ' ' + VarToStr(person.Age)); end; procedure TCOM_MainForm.MultipleCallButtonClick(Sender: TObject); var roserver: IROCOMServer; newservice: OleVariant; person: OleVariant; begin roserver := CoROCOMServer.Create; roserver.MessageType := 'BinMessage'; roserver.ChannelType := 'HTTP'; roserver.SetChannelProperty('TargetURL', 'http://localhost:8099/bin'); person := roserver.CreateComplexType('TPerson'); person.FirstName := 'Peter'; person.LastName := 'Baker'; ShowMessage(person.FirstName + ' ' + person.LastName); newservice := roserver.CreateService('MegaDemoService'); ShowMessage('The result is ' + IntToStr(newservice.Sum(101, 202))); ShowMessage('The time on the server is ' + DateTimeToStr(newservice.GetServerTime)); end; end.