changed ONE function from the sample code - 'sum' becomes 'hello' which simply returns a string saying 'hello'
the server compiles and runs
Now the problem starts...
i created a new client project - following the instructions in the same tutorial
used the interface file from the server project
the client project fails with the error message: [[Error] cnlService.pas(6): can't find unit "XData.Server.Module" (and seems to apply to all the xdata.* dcu modules)
have checked in the folders and the correctly named dcus are there
have added this to the project, options, delphi compiler, search path
What should be a simple learning exercise following your tutorials and documentation has turned into hours of wasted time, head-bashing, trying to figure out an error that should not be possible.
PLEASE can someone help!!!!
C
PS - this seems to be only this level of xdata dcus - i have written a sample with a sqlite database and a client accessing that database as per video "From Database to Web App through REST server with TMS XData and TMS Web Core". that does not directly use xdata.* dcus and compiles and runs perfectly.
type
[ServiceImplementation]
TcnlService = class(TInterfacedObject, IcnlService)
private
function Hello:String;
function EchoString(Value: string): string;
end;
implementation
function TcnlService.Hello:String;
begin
Result := 'Hello';
end;
function TcnlService.EchoString(Value: string): string;
begin
Result := Value;
end;
You forgot to mention one tiny information: your client application is a TMS Web Core application. That's a totally different beast than a regular Delphi application.
A TMS Web Core application doesn't support many things, like direct access database, FireDAC, Aurelius, XData server components (you shouldn't need to use XData.Server.Module in your data contract interface unit), and so on.
Using XData (and any other RESP API server) is different from TMS Web Core applications, and in this specific chapter we explain how to do it from Web Core: