BlackBerry Forums Support Community

Closed Thread
LinkBack Thread Tools
Old 12-13-2009, 12:38 AM   #1 (permalink)
New Member
Join Date: Nov 2009
Model: none
Carrier: none
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Http Posting to URL using WAP from various carriers

Please Login to Remove!

Pulling my hair out!

I have a simple app that Http Posts to a url. Works using BES, but it doesn't for people not on BES servers - just the average BB owner using Verizon, for example.

I have looked in many threads on many forums. Lots of suggestions. None work.

Do I NEED the WapGatewayIP/WapGatewayPort appendings to the url? If so, what are they SPECIFICALLY for Verizon? I seem to be making a connection, but when I open an inputstream from the connection, it gives me an exception after a time out.


HttpConnection connection = factory.getNextConnection();
try {
	connection.setRequestMethod( "POST" );
    	connection.setRequestProperty( "Content-type","application/x-www-form-urlencoded" );
    	os = connection.openOutputStream( );
    	os.write( getPostString(email, password).getBytes() );
    	is = connection.openInputStream();
    	//do something with the input stream
	int len = (int)connection.getLength();
        byte[] b = new byte[4096];
    	for (int n; (n = != -1;) {
    		System.out.println("(ResultInterface(post)2): IN loop - n = ["+n+"]");
    	        sb.append(new String(b, 0, n));
Also, where I set the appendings to the url:

if ("T-Mobile".equalsIgnoreCase(networkName)) {
	extraParams = ";WapGatewayIP=;;WapGatewayPort=9201";
} else if ("Verizon Wireless".equalsIgnoreCase(networkName)) {
	extraParams = ";WapGatewayIP=;WapGatewayPort=9201;retrynocontext=true;ConnectionSetup=delayed";
} else if ("Cingular".equalsIgnoreCase(networkName)) {
	extraParams = ";WapGatewayIP=;WapGatewayPort=9203";
} else if ("Nextel".equalsIgnoreCase(networkName)) {
	extraParams = ";WapGatewayIP=;WapGatewayPort=19781";
} else {
	extraParams = "";

Am I even in the ballpark?

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.