XDataWebConnection not Connection when accessing web from outside

After developing Server/Client applications for 40 years using Pascal/Delphi I have now ventured into a web application accessing a Rest Server. After investigation all the option I decided on TMS as a development platform. I must admit getting to the point where I am now has taken blood sweat and tears. It is difficult for an old donkey to change his ways.

I have created a XDataServer and a PWA using web XDataWebDataSets. I use PostgreSQl and Firedac to connect to the data

Everything works well during development.

I have my own internal WAMPServer. The XdataServer starts on my server and I can access the data via a web browser. I copied everything in the TMSWeb/Release folder over to the server.

When I access my PWA via a browser on the server everything works well but the moment I try to access the app from outside the PWA does display in the browser but does not connect to the server. The OpenAsync causes an exception but the message I initialise in the data module On error event returns nothing. At this stage I have only set the XDataServer middleware to COR

  Try
    aWait(Datamod.XDataWebConnection1.OpenAsync);
  Except
    ShowMessage('Exception ' + datamod.Mess);
    DataMod.DbConnected := False;
  End;
  if DataMod.DbConnected = True then
  begin
    xqMem.Close;
    xqMem.QueryString := '$filter=memberno eq ' + eMemNo.Text;
    aWait(xqMem.Load);
  end

1 Like

This can be a lot of things. We need you to provide more information about the exact error you are getting. Are you able to somehow get the errors from the browser console log?
Have you properly configured the firewall and network settings to allow your server to be reached from a client outside the server computer?

Hi Wagner

Aster the WAMPServer was setup for me I copied my old outdated website files form my hosting to my own web server and tested it without any problems. This website is mainly used to download my main applications install files. As I also mentioned the current website allows access from outside but XDataWebConnection has a problem opening the the XDataServer

I copied the TMSWeb/Debug folder files to my server and this is the console message that I get and it only indicates that there is an error connecting in the unit XData.Web.Connection.pas

XData.Web.Connection.pas:192 
        
       GET http://localhost/flix/$model net::ERR_CONNECTION_REFUSED
$impl.InternalSendRequest @ XData.Web.Connection.pas:192
SendRequest @ XData.Web.Connection.pas:432
DoConnect @ XData.Web.Connection.pas:304
(anonymous) @ XData.Web.Connection.pas:361
OpenAsync @ XData.Web.Connection.pas:358
bSignInClick @ uSignin.pas:97
cb @ rtl.js:237
Click @ WEBLib.Controls.pas:1689
HandleDoClick @ WEBLib.Controls.pas:3512
cb @ rtl.js:233

Do you have a server running at address http://localhost/flix? That's the server it's trying to reach.