I use Delphi 7 and import from a WDL file to create a SOAP client. Delphi generates interface code with the published functions from the WSDL and the types (classes) of parameters for those functions.
Delphi has determined that something like this
Message = class(TRemotable)
private
FMessageID: Int64;
Ftimestamp: TXSDateTime;
Fevent: eventType;
FmagicNumber: WideString;
FDataPart: DataPart;
published
property MessageID: Int64 read FMessageID write FMessageID;
property timestamp: TXSDateTime read Ftimestamp write Ftimestamp;
property event: eventType read Fevent write Fevent;
property magicNumber: WideString read FmagicNumber write FmagicNumber;
property DataPart: DataPart read FDataPart write FDataPart;
end;
should be send as a TByteDynArray ...
function sendMessage(const theMessage: TByteDynArray;
const data: DataPart): WideString; stdcall;
which necessitates me converting an object to a TByteDnyArray, which - beings Delphi n00b - I am doing this by
theMessageArray := TByteDynArray(theMessage);
When I look at the object in the debugger, then it contains pointers (to the Ftimestamp
and Ftimestamp
), and when I look in the TByteDynArray I see the self same pointer values. So, it seems that "cast" is not what I wanted. How do convert my object to the TByteDynArray which is required? (and which, presumably "inlines" the objects pointed to by pointers)
I presume that there is a standard approach for this ...