10-11-2008 03:53 AM
I have developed an application for my 8300 with software v 4.5
It consumes web services as client.
Each time the application tries to consume the web service a new screen shows asking user authorization to connect to the destination IP address.
How can I avoid this authorization request so my application runs without interruptions ?
Solved! Go to Solution.
10-13-2008 04:25 AM
You could use basic authentication (if your web server supports it) by adding the corresponding property to your http request. You should use SSL/TLS connection (HTTPS) in that case.
String login = "user" + ":" + "password";
String login_encoded = Base64OutputStream.encodeAsString(login.getBytes()
connection.setRequestProperty("Authorization", "Basic " + login_encoded);
10-13-2008 06:34 AM
Alternatively, this could be the standard BlackBerry "Firewall/Permissions" Connection Checking screen.
Does it have an 'ask once' check box at the bottom of the dialog asking the question? Try checking that.
If it is the Application Permissions, then you have a range of options including:
a) Have the user respond and use the 'ask once' option
b) Use the 'Set Permissions' option at download time when installing Over The Air
c) Set the Applications Permissions via the BES for this application (assuming you are pushing it from the BES)
d) Set the Permissions on the device - Options-->Advanced-->Applications-->Edit Permissions
e) Programatically in your Application
Look round here this forum for other users that have asked similar questions.
10-31-2008 01:17 PM
Thank you Ivanov for your answer.
I understand the request for permission to connect is done by the O.S.
The web service client within the Phone uses javax.microedition.xml.rpc.Operation, so I don´t know If I can control the attributes for the Http conection stablished by the Operation methos.
I will experiment and come back to you
10-31-2008 01:21 PM
Thank you Peter_strange for your answer.
I did change the permissions in the O.S. as you recommend.
After setting the permissions, the first time I launch the application it asks for permission.
When I close my application the close menu ask to "save or discard". If I select "save", the next time I use my application it does not ask for authorization for Http connection. I will review the BlackBerry docs to better understand this behaviour.
10-31-2008 06:22 PM
Additionally, The BlackBerry JDE 4.5 Development Guide states on page 228 that the HTTP connection should be put on a separate thread from the main thread.