Web Core/XData iOS errors

As for the errors, the 404 is promising.... it means something is answering your request. Likely means that your server is running on port 2001. What URL are you using? I'd start with this, which should be the same as the XData message from my screenshot. I appreciate though that you might not be using the same application template, so perhaps that isn't available. Regardless, the URL should be this:

http://localhost:2001/tms/xdata

2003 shouldn't connect because neither option in your code references 2003 anyway, so this is what you would expect. It is also what you would expect if the XData server isn't running inside the application (the server has been stopped, for example, or didn't successfully start in the first place).

If I change the xdata server to use port 2003 then I can connect to xdata and swagger on both the server and locally using http but of course I then can't connect using https.

That sounds like progress. Just the HTTPS issue then.

  1. Is the server outside your local network?
  2. Can you access the server over http using the same domain name that you want to use with HTTPS?
  3. Do you have another port number reserved for use with HTTPS?
  4. Are you sure that XData starts and is using that port with the baseURL specifying HTTPS as well?

Trying to access an HTTPS server using just an IP Address is generally not a good idea, hence the need to test that the IP Name is mapping to your server the way you expect it to.

  1. Yes,
  2. Not as such as it is set to redirect to https.
  3. There are other ports being used by other software such as RDP but no other ones relating to xdata.
  4. Yes and I alse check if the sparkle server is running.

Perhaps I do have a cors issue afterall?

Let's try and narrow things a little further, focused entirely on HTTPS for the moment.

  1. XData is running on a remote server.
  2. XData has a baseURL that includes https and a port number, say 2005 just to not be confusing.
  3. The port it is using is registered with the HTTP Config Tool, also as https with the same port number.
  4. This port number is only being used by XData, and that XData is running.
  5. The domain name for the system correctly maps to it.

From that server, you should be able to run a browser and connect to:
https://localhost:2005/tms/xdata

It will likely give off errors about SSL, but that's OK, should still work.

From your local network, you should be able to run a browser and connect to:
https://yourdomain.com:2005/tms/xdata

CORS doesn't start to become a problem yet. It is primarily concerned with accessing content from multiple domains in the same application via JavaScript. Using our browser tests, nothing CORS related will have come into play so any problems by definition are not CORS related, as we're not running JavaScript - just typing in URLS in the browser.

  1. Yes.
  2. Yes.
  3. Yes.
  4. Yes.
  5. Not sure what you mean by this. There are multiple domains and IP addresses on the server.

From the server https://localhost:2005/tms/xdata gives an unable to connect error.

Just confirming. Sometimes a domain name is registered but isn't pointing at the correct server. Making changes to domains sometimes has a delay before the changes are propagated. Or maybe an SSL certificate doesn't properly contain that domain name, that kind of thing. Just trying not to overlook obvious problems.

If 1-4 are correct, but https://localhost:2005/tms/xdata doesn't work, you could also try https://yourdomain.com:2005/tms/xdata instead, while on the server, maybe bypassing the errors normally thrown.

In addition to the HTTP Config Tool reserving an address, it must also be configured with the SSL certificate that is being used. That's a larger topic, so refer to the docs on how that's done. I use LetsEncrypt for my certificates, and it isn't hard to do, but whatever you're using has to come into play as well. The idea here is that you're passing the SSL certificate that contains the authorization for the domain you're using. It has to be linked to the port that has been reserved as well.

The domain name is working fine because I can connect to the web app from anywhere which displays the login screen. I tis only when logging in, which checks details with xdata that there is a problem.

I am also using LetsEcrypt for the certificates. Also use Certify the Web which auto re-generates the certificates when they expire and also, in the case of this domain, stores the certificate to the local machine.

In HTTPConfig on the SSL tab 0.0.0.0:443 was configured to use the applicable certificate. And there is the problem. I should have used the xdata port!!!

I can now login. Thanks for all your help Andrew. Enjoy the rest of your weekend.

1 Like