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
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: Sample HTTP Connection code and BIS-B Access. HTTPS bug?

A few Posts to catch up with:

 

@jaredstevens10:  Not really an appropriate question for this Thread.  This Thread is all about getting the response, not processing the response.  I suggest you start a new Thread. 

 

@areveillon:  Most of the longer term responders on this forum are Alliance members, so do not have so much hassle getting BIS-B access.  That said 2.5 months seems far too long. 

 

@AlexXF: I am contractually not allowed to publish details on how to access BIS-B.  If you have obtained this information from RIM, then you will be contractually obliged to not publish it too. If you have not obtained this access via RIM then wherever you got it from has in fact broken an agreement with RIM. 

 

Now the question is why do RIM want to stop people using this mechanism?  I don't know for sure, but I suspect this is an issue in sizing.  RIM has an infrastructure that is designed to support the BIS-B access that they know about.  If you start using this mechanism, then you could flood this and cause problems to their infrastructure.  So I think that is why RIM require every application to 'register', and give URLs involved and sizing information.  If you don't register, I suspect they could, if they wanted, block your access. 

Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha

Re: Sample HTTP Connection code and BIS-B Access. HTTPS bug?

@peter_strange

 

Please comment - do you have the same issue with CoverageInfo interface on 2G networks?

 

http://supportforums.blackberry.com/t5/Java-Development/OS5-0-6-0-Problem-detecting-coverage-status-...

Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha

Re: Sample HTTP Connection code and BIS-B Access. HTTPS bug?

Waiting one day for the solution... Found by myself.

 

@peter_strange, please fix your code in TransportDetective class

 

        private void updateTransportCoverageAvailability(){ 
                // reset cached availability
        	
        		//In 3G network it works...
                _availableTransportCoverage = 0;
		    
                //Required for 2G networks
                int _coverageStatus = CoverageInfo.getCoverageStatus();
                
                if(		(_coverageStatus & CoverageInfo.COVERAGE_DIRECT) > 0 ||
                		CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.getSupportedWAFs(), false)){
                _availableTransportCoverage |= TRANSPORT_TCP_CELLULAR;          
                _availableTransportCoverage |= TRANSPORT_WAP2;
                _availableTransportCoverage |= TRANSPORT_WAP;
                }
        
		        if( (_coverageStatus & CoverageInfo.COVERAGE_BIS_B) > 0 ||
		        	CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B) ||
		        	CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B, RadioInfo.getSupportedWAFs(), false)
		        	){
		                _availableTransportCoverage |= TRANSPORT_BIS_B;
		        }
		        if(
		        		(_coverageStatus & CoverageInfo.COVERAGE_MDS) > 0 ||
		            	CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS) ||
		            	CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS, RadioInfo.getSupportedWAFs(), false)
		            	){
		                _availableTransportCoverage |= TRANSPORT_MDS;
		        }       
		        if(CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT, RadioInfo.WAF_WLAN, false)){
		                _availableTransportCoverage |= TRANSPORT_TCP_WIFI;              
		        }
		        
		        Logger.logEventInfo("Coverage value " + Integer.toString(_availableTransportCoverage));
		        
        updateTransportServiceAvailability();
        _availableTransportCoverage &= _availableTransportServices;
        
        }

 

This code works on 2G/3G/CDMA networks. Tested.

Please use plain text.
Developer
sbeeckma
Posts: 20
Registered: ‎10-09-2010
My Device: Bold 9700

Re: Sample HTTP Connection code and BIS-B Access. Error 500

Hi,

 

I'm happy finally a decent networking library is available.

 

I got a weird error though. I've let the processConnection() the same (except for I commented out the POST data processing) and made the _urlToTry a hardcoded String.

 

In the BlackBerry Smartphone Simulator 2.13.0.97 for the 9700 (OS 5.0) it works for http://www.blackberry.com.

 

9700-3.png

 

However, when I want to get the XML from http://twunch.be/events.xml?when=future , I get Error 500. I even get when trying http://twunch.be ...

 

9700-02.png

 

So now I'm wondering where the difference comes from. Why would the server at http://www.blackberry.com give another response code than the server at http://www.twunch.be ? Something I should look for in the simulator?

Please use plain text.
Developer
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: Sample HTTP Connection code and BIS-B Access. Error 500

I think I am missing something here. 

 

500 typically means that the Server does not understand what you have sent it.  So this is not a weird error at all, you need to make sure you format your connection request (GET or POST) in a way that the Server understands. 

 

Since you appear to be doing 'GET' processing, try the same URL in a Browser and see what happens. 

Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha

Re: Sample HTTP Connection code and BIS-B Access. Error 500

sbeeckma, if you use connection type MDS/BES, then you _can_  get error 500 (for unknown reason) on XML document. Change it to BIS-B (if you have RIM Alliance membership) or Direct TCP :smileysad:

 

This is a known bug of BES/BESX server, as i wrote before.

Please use plain text.
Developer
sbeeckma
Posts: 20
Registered: ‎10-09-2010
My Device: Bold 9700

Re: Sample HTTP Connection code and BIS-B Access. Error 500

AlexXF, Peter,

 

first let me stress that I'm seeing this behavior in the simulator. I haven't tried it yet on my (BIS-B) device.

 

I'll try to force the BIS-B method in the simulator (should it make a difference?) and let you know.

Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha

Re: Sample HTTP Connection code and BIS-B Access. Error 500

[ Edited ]

@sbeeckma, this code, that provided @peter_strange DOES NOT CONTAIN BIS-B connection. If you look into, then you'll found that BES and BIS is the same methods.

 

If you want to use BIS-B, then you need to add 'missing' parameter in URLFactory class.

 

If you do not modify it, then there is no matter what you select BIS-B or BES/MDS, BES MDS will be used.

Please use plain text.
Developer
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: Sample HTTP Connection code and BIS-B Access. Error 500

And you can not actually use BIS-B connection on the SImulator anyway, even if you had the 'missing' parameter. 

 

Can I request that we take continued discussion of this specific issue off this Thread, which really should be focusing on the HttpLibrary code. 

Please use plain text.
Developer
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: Sample HTTP Connection code and BIS-B Access. Error 500

Just found this KB article - so you can automate the use of Direct TCP. 

 

http://supportforums.blackberry.com/t5/Java-Development/What-Is-Default-TCP-Service-Record/ta-p/9394...

 

I'm thinking of updating the sample code to use WAP and/or this method, since both can be specified without requiring any user interaction.  But don't hold your breath.

Please use plain text.