PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → How To Monitor Data Download From A Webservice
How To Monitor Data Download From A Webservice
Iniciado por guest, 28,nov. 2017 11:47 - 4 respuestas
Publicado el 28,noviembre 2017 - 11:47
Hi All

That says it all. What is the best way to display the progress of the download of data from a web service? Sounds crazy but I am seeing a chicken and egg situation looming before me.

Any ideas welcome - I now have clients claiming that they have no idea how long data is taking to download despite a message displaying that it is doing so. They now say that the app is hanging - which it is not.

Cheers
Andre
Publicado el 28,noviembre 2017 - 12:15
Hi André,

if most of the time is spent for the transfer of data (and not for the preparation/processing of data on the server side), -AND- if you use a REST type webservice -AND- if the server is sending back the content length information, then you can use httpprogressbar to show the download time.

In any other case, you can modify your process to split the data in small packets before sending it and merging them together when retrieving them, so that YOU can display a progressbar

Best regards
Publicado el 28,noviembre 2017 - 12:29
Hi Fabrice

Thanks for that. I have never worked with a REST type web service before. I suppose it is time to start then. Hope I can use all the existing code to still deliver. Really do not want to rewrite all of this.

Also, we have been using the WAS to host the services. Most of our clients are still on 19. They will need to upgrade. Not sure at what version REST services were introduced.

Your second suggestion also makes sense but more work.

Lots to think about.

Cheers
Andre
Publicado el 28,noviembre 2017 - 12:38
Hi again,


>>Thanks for that. I have never worked with a REST type web service before. I suppose it is time to start then. Hope I can use all the existing code to still deliver. Really do not want to rewrite all of this.<<

Sure you can... the webservice type is just the delivery service, your code is the meat and bones. That part will not change

Also, we have been using the WAS to host the services. Most of our clients are still on 19. They will need to upgrade. Not sure at what version REST services were introduced. <<


Actually, no upgrade is needed, as you can setup a REST type webservice simply by using an awp page on the webdev server (there is an example of that in WXReplication, which was originally written in 18/19).

What was introduced by pcsoft is a wrapper for that, nothing more.

So basically :
- client side : httprequest/httpgeresult and httpprogressbar, is the server is returning content lenght
- server side : one awp page with a pageparameter function call to get the content of the call, a call to your existing code to do what is needed, and a stringdisplay to send the result,
- don't forget to use the post mode on both side as your content clearly is quite big.

and you are done... (again, an example of all that is available in wxreplication)

Best regards
Publicado el 29,noviembre 2017 - 19:20
Thanks Fabrice - we are upgrading anyway as there other things we are needing.