0
votes

I have a DataSnap Server with a Server method like this:

function TServerMethods1.selectFalzUser(Usuario: string) : TDataSet;

Now, on the DataSnap Client using TSQLServerMethod, I successfully connect to the server in Design Mode, pull server's methods list ... select 'selectFalzUser'... and I can succesfully see my params, both Usuario as INput, and the output TDataset Param... when a try to set my SqlServerMethod Active ... I get the following error:

Error Remote error: TServerMethods1.selectFalzUserwhereUsuario method not found in the server method list.

Why Delphi is appending 'whereUsuario' string to the method name? Obviously TServerMethods1.selectFalzUserwhereUsuario does not exist.

Regards

zaguerino.

1
TDataSet is not a type you can return in a DataSnap remote function call. Un saludo.!jachguate
Hi , I was reading Bob Swart's White Paper: "Delphi 2010 DataSnap: Your data where you want it, how you want it", where it shows a Server Method named: function TServerMethods1.GetEmployees: TDataSet; What would be the correct type to return rows in a server method? Regards ZaguerinhoJorge Ramirez

1 Answers

0
votes

Without seeing more code it is hard to say why it isn't reporting the method name correctly. However, it doesn't sound like you are using DataSnap quite right. Here is what I have done successfully for several projects:

You must include {$METHODINFO ON} before the TServerMethods class definition and {$METHODINFO OFF} after the class definition in the DataSnap server. Then compile and run your DS server.

On the client side, add a TSQLConnection component and set its properties to connect to your listing DS server. Then right click the TSQLConnection and select Generate DataSnap client classes. Save this as something like ProxyMethods.pas and include it in your client project. Then you can access the ProxyMethods class to call any of the published TServerMethods in the server.

Also, returning TDataSet won't work with the approach I described because TDataSet is not a marshallable datatype, however OleVariant is. I have had good success with returning a TClientDataSet.Data, and then on the client side I can assign this directly the Data property of a client-side TClientDataSet.