Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Web Services

Reply
Contributor
mhorpheus
Posts: 15
Registered: ‎08-14-2013
My Device: Bold 9000
My Carrier: T-Mobile

How the BWS connection is working?

Hi,

 

 

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.

 

 

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How the BWS connection is working?

Each BWS call makes a new connection so the authentication lives across these, so you do not need to re-authenticate for every call.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Contributor
mhorpheus
Posts: 15
Registered: ‎08-14-2013
My Device: Bold 9000
My Carrier: T-Mobile

Re: How the BWS connection is working?

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?

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How the BWS connection is working?

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.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.