Hello,
I Test the XData Server Sample "Hello World" on a Windows10 PC. If I made the
request from the same PC as the Server runs, it will be working. If I made the request
from an other PC in the same Network, it doesn't work. Firewall was disabled.
http url was registered with the http.sys config Tool.
What did I forget or making wrong ?
Thx
Hello,
Hello,
The Windows 10 PC has only Windows Defender as antivirus and i turn it off for my test. I can make a ping to the maschine where the server is running.Ping was ok.
The exact Error Message that I get from the other Computer was: firefox the connection has timed out taking too long to respond
From the Client, I test with an Delphi Client, using TRestClient and I test it with Firefox Browser.
My Server Code:
program XDataServerProjX;
{$APPTYPE CONSOLE}
{$R .res}
uses
System.SysUtils,
Aurelius.Drivers.Base,
Aurelius.Drivers.Interfaces,
Aurelius.Drivers.FireDac,
Aurelius.Sql.SQLite,
Aurelius.Schema.SQLite,
Aurelius.Sql.MSSQL,
Aurelius.Schema.MSSQL,
Aurelius.Sql.FireBird,
Aurelius.Schema.FireBird,
Aurelius.Sql.Interbase,
Aurelius.Schema.Interbase,
Aurelius.Global.Config,
Aurelius.Engine.DatabaseManager,
Aurelius.Engine.ObjectManager,
Sparkle.HttpSys.Server,
XData.Aurelius.ConnectionPool,
XData.Server.Module,
FireDac.Stan.Intf,
FireDac.Stan.Option,
FireDac.Stan.Error,
FireDac.UI.Intf,
FireDac.Phys.Intf,
FireDac.Stan.Def,
FireDac.Stan.Pool,
FireDac.Stan.Async,
FireDac.Phys,
FireDac.VCLUI.Wait,
FireDac.Phys.SQLite,
FireDac.Phys.SQLiteDef,
FireDac.Comp.UI,
FireDac.DApt,
Data.DB,
FireDac.Comp.Client,
u_dataModuleMain in 'u_dataModuleMain.pas' {dmMain: TDataModule},
xdataServer.entities.customer in 'Entities\xdataServer.entities.customer.pas',
xdataServer.service.examples in 'services\xdataServer.service.examples.pas',
xdataServer.service.examples.impl in 'services\xdataServer.service.examples.impl.pas',
xdataServer.entities.customer.messages in 'Entities\xdataServer.entities.customer.messages.pas',
xdataServer.helper in 'helperClasses\xdataServer.helper.pas',
clKostenstellen in 'Entities\clKostenstellen.pas';
const
const_URL ='http://192.168.13.85:80/tius_rest';
procedure UpdateDatabase(_Connection: IDBConnection);
var
LDb: TDatabaseManager;
LManager: TObjectManager;
begin
LDb := TDatabaseManager.create(_Connection);
try
LDb.UpdateDatabase;
finally
LDb.Free;
end;
LManager := TObjectManager.create(_Connection);
try
// TXdataDataGenerator.generateSampleData(LManager,100);
finally
LManager.Free;
end;
end;
procedure StartServer;
var
Server: THttpSysServer;
XDataServerModule: TXDataServerModule;
ConnectionPool: TDBConnectionPool;
ConnectionFactory: TDBConnectionFactory;
begin
{$IFDEF DEBUG}
System.ReportMemoryLeaksOnShutdown := true;
{$ENDIF}
Server := THttpSysServer.create;
try
ConnectionFactory := TDBConnectionFactory.create(
function: IDBConnection
begin
// Using FireDac and Data Module
dmMain := TdmMain.create(nil);
Result := TFireDacConnectionAdapter.create(dmMain.FDConnectionFirebird, dmMain);
UpdateDatabase(Result);
end);
ConnectionPool := TDBConnectionPool.create(15, ConnectionFactory);
XDataServerModule := TXDataServerModule.create(const_URL, ConnectionPool);
XDataServerModule.AccessControlAllowOrigin := '';
Server.AddModule(XDataServerModule);
Server.Start;
Writeln ('Server started at address '+const_URL+'. Press ENTER to stop.');
ReadLn;
finally
Server.Free;
end;
end;
begin
try
StartServer;
except
on e: exception do
begin
writeln(e.Message);
ReadLn;
end;
end;
end.
Hello again,
I found the problem. With the Http.sys Config Tool I made a url reservation for http://+:80/tius_rest/
this works only for my local PC. Now I made a reservation for http://*:80/tius_rest/ and that works for all Computers in our Network.
Thx