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: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

403 error code while making HTTP Connection

I am using 9860 7.0 phone.I have a BIS sim.Till two days back,i was able to make http conenction to fetch image from an URL.It was returning 200 response code.Suddenly from yesterday its returning 403 error code.Now when i set the APN its coming as 200 again,but earlier without setting APN also i used to get 200 code.How can i fix this?

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

Re: 403 error code while making HTTP Connection

And what does 403 mean?  Investigate, then check the connection method that your program was using when it got the 403. 

Contributor
Posts: 34
Registered: ‎05-02-2013
My Device: 9700
My Carrier: Idea

Re: 403 error code while making HTTP Connection

When accessing a website using BlackBerry Browser, one of the following error messages appears on the BlackBerry smartphone:

HTTP Response Code 403 Forbidden. Not authorized to access link.

OR

HTTP Error 403 Forbidden. You are not authorized to use this page.

Also, the BlackBerry Mobile Data System log (MDAT) log shows entries similar to the following example:

HTTP/1.0 403 Forbidden
IPPP, u2e Not authorized to access http://www.blackberry.com

 

 

http://btsc.webapps.blackberry.com/btsc/viewdocument.do;jsessionid=C84DBEAB7469862C93594402B667E600?...

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

Re: 403 error code while making HTTP Connection

Are you still looking for help with this?

 

We need to know what connection method you were using when you got the 403.

 

I strongly suspect that you have somehow changed the connection method and are now going through a different gateway, and it is the gateway that is giving you this error. 

 

To tie this down completely, it may be appropriate for you to check the headers that are returned with the 403 to find out what Server it has actually be returned by. 

Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: 403 error code while making HTTP Connection

I am using connection factory class,so it appends deviceside=true to my url,i dont know why.Earlier it didnt used to append deviceside=true until and unless my apn is set

Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: 403 error code while making HTTP Connection

After this line of code

 conDescriptor = factory.getConnection(Url);

it is appending deviceside=true to my url

Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: 403 error code while making HTTP Connection

My browser is working,i can open any website

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

Re: 403 error code while making HTTP Connection

"it is appending deviceside=true"

How do you know it is doing this?

 

What options did you give ConnectionFactory to choose between? 

 

Is this the connection method you expect it to use?

 

 

Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: 403 error code while making HTTP Connection

i have ofcourse printed the url,thats why i am knowing wat is being appended to it.And regarding the connection type,no i am not expected it to be tru,rather i am expecting it to be false if APN is not set.I have given the following methods to pick from,depending on availibility

 

setPreferredTransportTypes( new int[] {
TransportInfo.TRANSPORT_MDS,
TransportInfo.TRANSPORT_BIS_B,
TransportInfo.TRANSPORT_TCP_WIFI,
TransportInfo.TRANSPORT_TCP_CELLULAR,
TransportInfo.TRANSPORT_WAP2,
TransportInfo.TRANSPORT_WAP

});

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

Re: 403 error code while making HTTP Connection

[ Edited ]

It seems unualal for it to choose Diect TCP given your preferred transport types.  Does it choose WiFi if that is working?

What connection type is chosen if you remove TRANSPORT_TCP_CELLULAR?

 

Are we still researching a 403?