My Compact Framework / Windows CE app, running on a Motorola 3190 handheld device, needs to call a RESTful method in a Web API app.
The handheld devices are connected to a host machine whose IP address can apparently be deduced via:
IPAddress IPAddr = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];
But if I try to use this to call the server on which the Web API app runs, all Dallas breaks loose
So I'm thinking: do I need the handheld device to attach to its host machine using its IP Address and then from there have another IP Address for the server machine (not the same machine in "real life," but it is the same machine at development time).
IOW, do I need something like:
string uri = string.Format("http://{0}:{1}:28642/Bla/Bla?Bla=Blee&Bloo=Gloo", ActiveSyncHostIPAddress, WebAPIServerAddress);
?
I don't know if that is even "legal" (IPAddress1:IPAddress2) or, if not, how this needs to work.
IOW, the handheld device needs to connect to its host (which is usually at the customer's site) in order to communicate with it. But then that host needs to communicate with the server which contains the app which exposes the RESTful (Web API) methods.
At design time, there are only two players:
Handheld Device => Dev Machine (which is the handheld device's Host and is running the server/Web API app)
...but in the field, there are three players:
Handheld Device => Host on Premises => Server running the Web API app
How is this accomplished without the "Host on Premises" having carnal knowledge of the "Server running the Web API app"?
OR, am I thinking about this wrong, and I just need to connect directly from the handheld device to the Web API server? If so, how can I do that? IOW, can the handheld device / Compact Framework app bypass its host and go straight to its ultimate destination?