NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: walter.dasilva on April 04, 2017, 10:25:14 AM
-
Hi,
Consuming web services from NT web server app is slower than calling from browser or nt demo.
https://viacep.com.br/ws/12511320/json/unicode/
12511320 is record parĂ¢meter
use 12500000 for error
trying it from browser or nt demo webclient is very fast, about a sec, but if i try from my ntws is taking about 65 sec.
Thanks
Walter
-
Hi Walter,
My guess is you've made a mistake in your implementation in the web sever.
It sounds like you are not closing the window when the page is received - only on errortrap - and you're getting an error when the connection times out. But that's just a guess.
Unfortunately to be more accurate I'd need to see an example.
cheers
Bruce
-
Hi Bruce,
I think i'm closing window.
Regards,
-
Thanks for the example Walter.
Aside - make sure you start the progress control at 1, not 0.
There are 2 ways for a server to indicate the page is complete. The first is to set a content-length in the header, then when that has arrived you know it's done. The second is to close your connection.
The server you are talking to though uses a third approach. It sets the Transfer-Coding to chunked (usually done with data streaming) and then adds an end-of-stream marker at the end. This is very cunning, and completely allowable. I will adjust the Webclient class to allow for this. The update will only be in the 9.25 update though - but I could send you an interim file. Which build are you currently on?
Aside: It works in NetDemo because that shows you the data, in .Process, as it comes in - it doesn't wait for PageReceived...
Cheers
Bruce
-
Hi Bruce,
I'm on 9.24.
So, how to close connection there? i'm trying .close with no effect and .closeserverconnection with error.
Best Regards,
-
you need to wait for 9.25 Walter - which should be out early this week.
-- update -- it's out now Walter.
cheers
Bruce
-
Upgraded to 9.26 and works pretty fine.
Thanks Bruce.