Hi,
I'm trying to call a XDataServer from within another XDataserver using TXDataClient.
This works fine on Windows, but not within an apache webbroker. I haven't tested on Linux without apache, but I'm convinced that that would trow the same error. I probably need to add something to the TXDataClient, but couldn't find any information for Linux.
{
"error": {
"code": "NetHTTPCertificateException",
"message": "Server Certificate Invalid or not present"
}
}
The certificate is fine: it works on Windows and browsers also accept the certificate.
The code:
var
Client : TXDataClient;
XDataService : IMonitoringService;
begin
Client := TXDataClient.Create;
try
Client.Uri := 'https://staging-lmsserver.evo-it.nl/lmsserver';
XDataService := Client.Service<IMonitoringService>;
result := XDataService.healthcheck;
finally
Client.Free;
end;
end;
Interface:
unit UnMonitoring;
interface
uses
XData.Service.Common;
type
[ServiceContract]
[Route('')]
IMonitoringService = interface(IInvokable) ['{C6D8E238-900D-4DD5-9030-93DC79CFD2F8}']
// By default, any service operation responds to (is invoked by) a POST request from the client.
[Route('healthcheck')]
[HttpGet] function Healthcheck: string;
end;
implementation
initialization
RegisterServiceType(TypeInfo(IMonitoringService));
end.
Everything works fine using TRestClient, TRestRequest and TRestResponse. So I implemented that for the meantime.
Thank you!