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: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

Hi Peter,

 

Can you ellaborate on it plz?

 

connection type: is empty here in demo application

 

what should  be the connection type,and with this only we can create BISBOptions Object?or else it will be incorrect?

 

Am i right?

 

Thanks

Rakesh

 

 

 

 

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

Re: Http Connection Issue getting Connection Descriptor Null

I don't think BisBOption is tricky to use:

 

http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/io/transport/options/BisBOptio...

 

The connection type is empty in the demo because the connection string is the same connection string you used in the Liegacy Alternative, which you are not allowed to share. 

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

hi Peter,

 

As specified by you ,Connection String which is not allowed here to share,If i use in BIS Otptions and set it alone ,it works,

 

Should i add this new Connection type and set it in connectionfactory,if connection descriptor is null?

 

Is this way to proceed?

 

It is weird,Can you suggest to way a standard way to handle this issyue?

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

Hi Peter,

 

Previously while it was working,It did not work as BIS,It worked as WAP ,and connectionURL ends with connectiontype=UidWap2trans(Something like this not sure exactly).But i was using BIS Only taking WAP Parameter,

 

 

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

Re: Http Connection Issue getting Connection Descriptor Null

[ Edited ]

Not sure what you are asking here. 

 

The idea with ConnectionFactory is you set the transport types you want to use, and it finds the first one that will actually work. If you want it to use BIS-B, then you should include that option.  But in order to use BIS-B, then you will have had to set the transport option previously.  You can set that transport option and that does not force ConnectionFactory to use BIS-B, it just allows BIS-B to work when ConnectionFactory trys to use that connection method. 

 

When you describe the connection methods can you please distinguish them clearly.  And do not confuse the BIS data plans with BIS-B connection method. 

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

Hi Peter,

 

I have gn list of prefered transport types

 

int[] preferredTransportTypes = { TransportInfo.TRANSPORT_BIS_B,
					TransportInfo.TRANSPORT_TCP_WIFI,
					TransportInfo.TRANSPORT_MDS, TransportInfo.TRANSPORT_WAP,
					TransportInfo.TRANSPORT_WAP2 };

 

 

 

ConnectionFactory _factory = new ConnectionFactory();
_factory.setPreferredTransportTypes( preferredTransportTypes );        
ConnectionDescriptor con = _factory.getConnection(smsurl);
if(con!=null){
//Connectivity is available
Connection connect = con.getConnection();            
request = (HttpsConnection)connect;
System.out.println("Requested URL is>>>>>"+request.getURL());
else
//Connectivity is Down
}

 

you are saying BIS option is not configured Correctly,SO that is reason not getting connected right?

By default BIS option should be there peter,Should i set BIS option manually like you specified ?

 

Thanks

Rakesh

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

Re: Http Connection Issue getting Connection Descriptor Null

Let us review the significant parts of this Thread.

 

I have told you to do this

"Create a BisBOptions Object and use ConnectionFactory setTransportTypeOptions() to enable BisB access using ConnectionFactory."

 

And then you did the following, which seems to be correct in terms of the way to do it, just incorrect in terms of the settings required for BisBOptions.

"BisBOptions options = new BisBOptions(TransportInfo.getTransportTypeName(TransportInfo.TRANSPORT_BIS_B));
ConnectionFactory _factory = new ConnectionFactory();
_factory.setTransportTypeOptions(TransportInfo.TRANSPORT_BIS_B, options);"

 

You said that didn't work, I suggested you correct your BisBOptions, you then said

"If i use in BIS Options and set it alone ,it works,"

and asked

"Should i add this new Connection type and set it in connectionfactory,if connection descriptor is null?"

 

To which I explained the process.  You have now asked:

 

1) "you are saying BIS option is not configured Correctly,SO that is reason not getting connected right?"

Correct, assuming I understand what you have written. 

 

2) "By default BIS option should be there peter,Should i set BIS option manually like you specified ?"

This question I don't understand.  If you don't set it, BIS-B doesn't work.  You know this, you tried it.  So I don't understand why you are asking this.

 

Anyway, to give you a specific example, here is something like the code I would expect you to have.

 

int[] preferredTransportTypes = { TransportInfo.TRANSPORT_BIS_B,
TransportInfo.TRANSPORT_TCP_WIFI,
TransportInfo.TRANSPORT_MDS, TransportInfo.TRANSPORT_WAP,
TransportInfo.TRANSPORT_WAP2 };

 

ConnectionFactory _factory = new ConnectionFactory();
_factory.setPreferredTransportTypes( preferredTransportTypes ); 

 

BisBOptions options = new BisBOptions(...);

_factory.setTransportTypeOptions(TransportInfo.TRANSPORT_BIS_B, options);

 

ConnectionDescriptor con = _factory.getConnection(smsurl);

 

I hope this is clear now. 

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Http Connection Issue getting Connection Descriptor Null

Hi Peter,

 

Thanks for making it clear.

 

Configurred BIS option works some times and sometimes not,very weird,

 

One more thing I am implementing RadioStatusListener,To Check whether dataConnectivity state is up or down,,

 

So as a result i am implementing as public void pdpStateChange(int apn, int state, int cause) {

}

 

Here I am getting state as 2-PDP_STATE_REJECTED     2

cause-33-PDP_CAUSE_SERVICE_NOT_SUBSCRIBED     33

 

Thanks

Rakesh

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

Re: Http Connection Issue getting Connection Descriptor Null

"Configurred BIS option works some times and sometimes not,very weird,"

 

Can't comment - in the UK, BIS-B seems to work well and consistently.

 

"One more thing I am implementing RadioStatusListener,To Check whether dataConnectivity state is up or down"

 

To be honest, I am not sure of the value of this - the radio being up doesn't guarantee that the site is accessible, so you still have the same potential issues to deal with in your communication code.  So I would suggest you just check the state before you attempt a connection if you really want, - and of course ConnectionFactory checks for you anyway. 

 

You might find this helpful re your PDP issues:

http://en.wikipedia.org/wiki/GPRS_core_network

 

Not something I have ever looked at.