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
Developer
Posts: 193
Registered: ‎04-27-2009
My Device: Not Specified
Accepted Solution

Application not connecting to the server using WAP2.0

[ Edited ]

Hi,

I used following code to get url suffix which is required to connect application to the server using WAP2.0

		if(CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT))
		{	
				//WAP 2.0
			String uid = null;
		    ServiceBook sb = ServiceBook.getSB();
		    ServiceRecord[] records = sb.findRecordsByCid("WPTCP");
		    for (int i = 0; i < records.length; i++) {
		        if (records[i].isValid() && !records[i].isDisabled()) {
		            if (records[i].getUid() != null &&
		                records[i].getUid().length() != 0) {
		                if ((records[i].getCid().toLowerCase().indexOf("wptcp") != -1) &&
		                    (records[i].getUid().toLowerCase().indexOf("wifi") == -1) &&
		                    (records[i].getUid().toLowerCase().indexOf("mms") == -1)   ) {
		                    uid = records[i].getUid();
		                    break;
		                }
		            }
		        }
		    }
			
			if(uid!=null) 
			{
				if(AppConfigurations.DEBUG) 
					System.out.println("Connected using direct WAP2.0...."); 
				return ";ConnectionUID="+uid;
			}	
		}

 

I am getting same ConnectionUID as present in Servicebook present in Options in the device.

Still application not connecting to the server using WAP2.0.

Let me know what other things i have to check to make application connect to the server using WAP2.0.

 

My Device is BB 8900 and OS 4.6.1

Developer
Posts: 193
Registered: ‎04-27-2009
My Device: Not Specified

Re: Application not connecting to the server using WAP2.0

Any help??

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Application not connecting to the server using WAP2.0

WAP connection will go through the carrier gateway.  This gateway may object to your connection, or might be trying to optimize the data or may want to display a login page to you.  Try the same URL you are using in your program, directly with the WAP Browser on the device and see if that actually gets through.

Developer
Posts: 193
Registered: ‎04-27-2009
My Device: Not Specified

Re: Application not connecting to the server using WAP2.0

Hi ,

I am  trying to make https connection using carrier WAP Gateway.

I contacted to tech support of my carrier in my case airtel they told they are not supporting https connections using wap gateway.

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Application not connecting to the server using WAP2.0

"they are not supporting https connections using wap gateway"  Really? that is not good!  :smileymad: