10-10-2013 02:20 PM
I'd like to understand how the connection is established when I'm using the BWS for communicating with the BAS.
As much as I know so far, is that I have to call the getAuthenticator(), the getEncodedUserName and to set the Credentails properly, but I don't know how long is this connection valid?
I'm about to make an application that should run long time, and when the user interacts it need to run different bws calls.
Do I need to call the setup process every time when a command need to be executed, or there is a timeout value and after that the connection need to be re-established?
The bwsService class has a Timeout property but it is the timout value of the established period.
10-11-2013 07:35 AM
Each BWS call makes a new connection so the authentication lives across these, so you do not need to re-authenticate for every call.
10-11-2013 08:10 AM
So it is possible that I setup the connection at the startup of the program, and later I just make the calls and it'll work?
e.g. in extreme situation open the connection in the morning and do the first call at the night?
10-11-2013 08:12 AM
No, those would timeout. BAS has an authentication timeout, and the framework being used may as well. Check into the docs for both for more details about how authentication is handled.
If a timeout occurs you will receive a 401 back to your app, this could be used as a signal to re-authenticate.