Hi Rick, I'm using webconnect to provide api endpoints to a cloud-based point-of-sale system. There are several functions webconnect provides (all of which are working really well). One of them is a customer-specific price lookup (using a complex alogorithm called from WC to the ERP server), The unit-price is returned from the WC api endpoint to the cloud-based point-of-sale line-item detail. Really quick response-time (usually less than 20 milliseconds) However, when the WebConnect server has sat idle for about 20 minutes, the item has to be deleted and re-entered several times for the WC price endpoint to respond. How can I "ping" the webconnect server every 5 minutes between the hours of 7:30 am and 6:00 pm to ensure it is not idle? Thanks again.
Hello Ron,
It's a very strange behavior, by nature, a Webconnect server listens. If it's no longer listening, it's because it's doing something very heavy or failed, and a "ping" won't wake it up ?
Marcel
PS : I am impressed by your production response time.
Hi,
I'll try to word my question differently. According to Rick, the webservice is not constantly listening. IIS will shut it down if it stays idle for more than 20 minutes. It needs a request to "wake it up". I need to send a couple of requests every 5 minutes to keep it listening. Otherwise the time it takes for IIS to "wake up" is too long and the api call does not get executed fast enough and timesout in the cloud-based point of sale. So, I need to know how to issue an automatic ping to it every 5 minutes to make sure IIS does not shut it down.
Hi, Tks I learn something, I was not aware of IIS pool OnDemand configuration.
With this config first request is always slow and that's why you want to wake it up on purpose.
You can add this method in your restprocess and call it remotely
FUNCTION ProcessPing
RETURN .T.
ENDFUNC

The IIS idle timeout is configurable in the IIS Application Pool configuration. It defaults to 20 minutes, but you can make it much longer so it happens less frequently or not at all.
For pinging - years ago I created a Web Monitor application that you can run in the background. You can have it ping one or more Web sites (and it can be as simple as a static page) once every couple of minutes (or less if you like). This keeps the server alive basically all the time, and it also notifies you when there's a problem and the server doesn't respond.
It's an old and kind of dated app, but it still works perfectly well - I use it on my servers and it pings each of my 30 or so applications running on it. It can run as a Windows Service in the background.
+++ Rick ---
I've sorted out the issues I've ben running into, but this one has me stumped. I'm relaying a webconnect server endpoint call to another one using
loProxy = CREATEOBJECT("wwJsonServiceClient")
loProxy.callservice(url,relayedobject,"PUT")
in one function, this works perfectly (the webserver that ultimately returns the value is behind a firewall and only allows a specific IP in and does some complex pricing).
However, in a different call, the relayed object somehow gets translated into a different format. Does the proxy.callservice change the relayed object?
Hi again,
Here's the function that produces a file with the embedded sale id and in the desired JSON format when the object is not relayed:
lcPayload = Request.Params("payload")
LOCAL loJsonSerializer, lcJson
loJsonSerializer = CREATEOBJECT("wwJsonSerializer")
loResult = loJsonSerializer.DeserializeJson(lcPayload)
STRTOFILE(lcPayload,"lsjson\saleupdate\"+loResult.id+"_"+GetUniqueId()+".json")
However, when I forward the parameter to an identical function on the second server, I run into issues.