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

Java Development

Reply
New Developer
AtariPete
Posts: 8
Registered: ‎08-21-2008
My Device: Not Specified

HTTP via WAP 2.0 & ServiceBook does not seem to work

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? 

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

The space does not need to be removed.  What behaviour are you seeing?  Are you getting an exception within your application or running into a connectivity issue?  Please also ensure that your carrier allows third party applications to connect through its WAP 2.0 Gateway as well as allow the type of connection you are making.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
AtariPete
Posts: 8
Registered: ‎08-21-2008
My Device: Not Specified

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

>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?

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

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.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
sachin_r
Posts: 81
Registered: ‎01-28-2009
My Device: Not Specified

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

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.

Don't forget to mark your post as solved if you got answer. And give kudos.
Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

If you review the link provided in the first post, you will see that the parameters you are talking about are for a WAP 1 gateway, ConnectionUID is for WAP 2.
Please use plain text.
Developer
javame_black
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

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

 

 

Regards
Sunil
Please use plain text.
Developer
sachin_r
Posts: 81
Registered: ‎01-28-2009
My Device: Not Specified

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

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

Don't forget to mark your post as solved if you got answer. And give kudos.
Please use plain text.
Developer
peter_strange
Posts: 19,595
Registered: ‎07-14-2008
My Device: Not Specified

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

If you want to use WiFi, first review the network Transports video:

http://www.blackberry.com/DevMediaLibrary/view.do?name=NetworkingTransports

 

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/message?board.id=java_dev&message.id=16000

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=898

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=16990

 

I don't understand this question:

"What should i do in case of network supports wap2"

Please use plain text.
Developer
robinShazam
Posts: 85
Registered: ‎12-05-2008
My Device: Blackberry 8900 Javelin

Re: HTTP via WAP 2.0 & ServiceBook does not seem to work

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!

Please use plain text.