<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is my first question to the Digest, so I hope
this is right way of submitting it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I am trying to consume a Web Service. Have got it
working ok for simple returns of XML strings, but am completely stuck on how to
handle the return of multiple records in a TRemotable Object.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here's the code that I think relates to
it:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> GetLatestTransactionsResult =
class(TRemotable)<BR> private<BR> FUniqueId:String;<BR>
FPeopleId:String;<BR> FSiteLoginId:string;<BR>
FSiteLogoutId:string;<BR> FErrorCode:integer;<BR>
published<BR> Property UniqueId: string read
FUniqueId write FUniqueId;<BR> Property PeopleId:
string read FPeopleId write FPeopleId;<BR>
Property SiteLoginId: string read FSiteLoginId write
FSiteLoginId;<BR> Property SiteLogoutId: string
read FSiteLogoutId write FSiteLogoutId;<BR>
Property ErrorCode: integer read FErrorCode write FErrorCode;<BR>
end;<BR> TFieldInfoArray = array of
GetLatestTransactionsResult;<BR></FONT></DIV>
<DIV><FONT face=Arial size=2> DataPortalExSoap =
interface(IInvokable)<BR>
['{94DBE733-A57C-9EBF-B5CD-167163F4ECAF}']<BR> function
GetLatestTransactionsEx(const ID: string; const Password: string; const
ExternalRef: string; const FindByBatchNo: string; const FindByExternalRef:
string): string; stdcall;<BR> end;<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>initialization<BR>
RemClassRegistry.RegisterXSClass(GetLatestTransactionsResult,
'http://www.ezitracker.com/eziTrackerData/',
'GetLatestTransactionsResult');<BR>
RemClassRegistry.RegisterXSClass(GetLatestTransactionsResult, '', 'TFieldInfo',
''); <BR>
RemTypeRegistry.RegisterXSInfo(TypeInfo(TFieldInfoArray), '',
'TFieldInfoArray'); </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>finalization <BR>
RemClassRegistry.UnRegisterXSClass(GetLatestTransactionsResult); <BR>
RemTypeRegistry.UnRegisterXSInfo(TypeInfo(TFieldInfoArray)); </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> </DIV>
<DIV>and then on the Form with my test buttons:</DIV>
<DIV> </DIV>
<DIV>procedure TFormMainForm.ButtonGetLatestTransactionsClick(Sender:
TObject);<BR>var id:string;<BR>
password:string;<BR>
nonnullresponse:boolean;<BR>
record_array:GetLatestTransactionsResult;</DIV>
<DIV> unique_id:string;<BR>begin<BR>
id := 'aaa';<BR> password :=
'bbb';<BR> nonnullresponse := True;</DIV>
<DIV> </DIV>
<DIV> record_array := GetDataPortalExSoap.GetLatestTransactions(id,
password, nonnullresponse);</DIV>
<DIV> </DIV>
<DIV> <BR>end;<BR><BR></DIV></FONT>
<DIV><FONT face=Arial size=2>It appears to run ok, but I have no idea how to
extract the data from record_array. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If I try something as simple as:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>unique_id := record_array.UniqueId[1];</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I get an EAccessViolation.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Can anyone help please.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I can't seem to find any ideas on the Web, probably
because the answer it too obvious.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>Mark </FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT> </DIV></FONT></BODY></HTML>