#1 Re: mORMot 1 » support objects in the interface (bug entry d19d9d67f2) » 2012-05-30 21:11:36

Agree on TRemotable, thanks for pointing me to the other blog post.

#2 mORMot 1 » support objects in the interface (bug entry d19d9d67f2) » 2012-05-28 19:43:34

JensG
Replies: 2

Hi,

I refer to this entry http://synopse.info/fossil/tktview?name=d19d9d67f2.

My request was:
Please support objects too, like Embarcadero does with SOAP.

Your answer was:
It is as designed. As stated by the documentation: how will be in charge of freeing the instance? If you want to retrieve some class instance content, you may use a var parameter with the instance: it will be unserialized on the function return.

Well, I have read that. The answer to the freeing question is, why I wrote "like Embarcardero does it with SOAP". It works there so I don't see a valid reason why it could not work here too.

Next, the fact how an class instance is returned, either via var/out param, or via return value seems not to affect the freeing question at all, does it?

Last not least, I have tried to use an class instance as var parameter, as suggested in the docs. Here is the code I used:


  TFoo = class( TRemotable)
  protected
    FBar : string;
  published
    property Bar : string read FBar write FBar;
  end;

  ITest = interface( IInvokable)
    ['{03517954-B3AF-4265-93D7-67AFCC2AA06C}']
    procedure GiveMeAFoo( var retval : TFoo);
  end;

It did not work, saying "First chance exception at $xxxxxxxx. EServiceException with message 'ITest.GiveMeAFoo: retval parameter has unexpected type TFoo'.". Maybe I just did something wrong?


BTW, nice project, good work.

Board footer

Powered by FluxBB