09-23-2008 04:03 PM
Overview
I am unable to make a HTTP connection via the WAP 2.0 gateway using the UID value found withing Blackberry's service book records.
Background
Blackberry's knowledgebase article "What Is - Different ways to make an HTTP or socket connection" discusses how the user can make a http connection via the wap 2.0 gateway by searching the service book for the appropriate ConnectionUID postfix value. Specifically using this code:
ServiceBook sb = ServiceBook.getSB(); ServiceRecord[] records = sb.findRecordsByCid("WPTCP"); String uidPostfix = null; for(int i=0; i < records.length; i++) { //Sarch through all service records to find the
//valid non Wi-Fi WAP 2.0 Gateway Service Record. if( records[i].isValid() && !records[i].isDisabled() && records[i].getUid() != null && records[i].getUid().length() != 0
&& records[i].getUid().toLowerCase().indexOf("wifi") == -1) { uidPostfix = ";ConnectionUID=" + records[i].getUid(); break; } }
Issue
Running this on an actual device I get a UID value of "MMS 5009", thus making the connection postfix value ";ConnectionUID=MMS 5009".
When I attempt to open an HTTP connection using this postfix it fails. I assume that this is because the UID value is incorrect.
Questions
Why am I unable to make a HTTP connection with this found ConnectionUID postfix (such as "www.google.com;ConnectionUID=MMS 5009"? Should I remove the space within the UID value, or is there an other reason for this issue?
When making a wap 2.0 connection, do I just need to postfix the ConnectionUID info or do I need to also provide the WAPGateWayIP?
09-24-2008 12:44 PM
09-24-2008 02:20 PM
>What behaviour are you seeing?
Odd, on first run i recive a network tunnel excetption with info about a connection timeout. But after that it seems to run fine.
Is there an existing issue whereby using the ConnectionUID doesn't work on first try? or maybe it was just the network....
Do all newer models of Blackberry (Pearl 8100 and above) support WAP 2.0 so long as it is supported by the carrier?
09-24-2008 03:27 PM
WAP 2.0 connections should be supported on the BlackBerry Pearl, as well as more recent BlackBerry models. This assumes that the carrier you are using also has a WAP 2.0 gateway in place.
Are you able to reproduce the first failed connection? If so, under what circumstance does this occur? The first time the application is run, the first connection attempt you make or some other event?
What BlackBerry model and handheld software version are you testing on? You can see this under Options, About.
01-28-2009 07:57 AM
Hi All,
Im new to forum and blackberry development for communication to server.
Is there any need to mention WAPgetwayIP and WAPGatewayAPN if we are adding ConnectionUID?
Thanks.
01-28-2009 08:30 AM
01-28-2009 09:24 AM
Hi,
I ran into signing issues when using ServiceBook API to access UID for WAP 2.0. If you think UID is incorrect then you can check that UID in your handset by going to
Options -> Advanced Options -> ServiceBook -> WAP 2.0 [WPTCP].
I dont remember exact path but I think its similar to the one above. In that you will find UID for WAP 2.0. So either append that directly in URL or get that value using ServiceBook API. If you are using ServiceBook API then make sure that UID you get is similar to the one specified in Mobile.
I have directly mentioned the UID from there in URL and it worked fine for me. There was no need to use ServiceBook API. Anyways hope that this helps you out.
Thanks & Regards
Sunil
01-28-2009 09:48 AM
Thanks.
Im developing the application for all over world, so i cannot append hard coded UID
By using service book API I got it.
But what if i wnat to use wifi. What should i do in case of network supports wap2.
Thanks
01-28-2009 11:53 AM
If you want to use WiFi, first review the network Transports video:
http://www.blackberry.com/DevMediaLibrary/view.do?
You will find a number of WiFi related Threads on this forum, which contain interesting information. I would suggest you check out these ones, but there are others too.
http://supportforums.blackberry.com/rim/board/mess
http://supportforums.blackberry.com/rim/board/mess
http://supportforums.blackberry.com/rim/board/mess
I don't understand this question:
"What should i do in case of network supports wap2"
01-28-2009 12:33 PM
WAP2 works for T-Mobile UK. Have you tried adding ;deviceside=true before your connection? I am not sure if the deviceside bit is needed for wap2 but its worth a go. For example,
<URL HERE>;deviceside=true;ConnectionUID=<YOUR SERVICE BOOK UID HERE>
Also, when checking for a wptcp/wap2 entry i check if "wap2" (no quotes) is in the name rather than checking "wifi" isn't. Our 8120 has "wi-fi" (with middle dash) in it so - using your code - you would pick up wi-fi if it was earlier in your scan than wap2 which wouldn't be cool if wap2 is what you really really wanted. Hope that helps!