I'm trying to use records with web services application in Delphi 32, the records defined as
TMyRec = record
Val1:integer;
Val2:string;
end;
TMyClass = class(TRemotable)
private fMyRec:TMyRec;
published
property MyRec:TMyRec read fMyRec write fMyRec;
end;
ITMyService = interface(IInvokable)
['{6283B8DA-C567-4814-906E-321729B1AE72}']
function GetMyClass(id:Integer):TMyClass;stdcall;
end;
but it doesn't exposed as on WSDL file, so is there problem when using records?
I'm using Delphi 2009
Even if the compiler does not prohibit to publish the record data types, it does not provide the full support for it - see docwiki
Updated:
You can always publish the separate fields instead of the whole record:
TMyRec = record
Val1:integer;
Val2:string;
end;
TMyClass = class(TRemotable)
private fMyRec:TMyRec;
published
property MyRecVal1:Integer read GetMyRecVal1 write SetMyRecVal1;
property MyRecVal1:string read GetMyRecVal2 write SetMyRecVal2;
end;
You must implement simple getter and setter methods to access fMyRec fields. I hope that helps, though I am not sure that is what you are looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With