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
Highlighted
Developer
Posts: 98
Registered: ‎08-17-2010
My Device: BlackBerry 8300 simulator
My Carrier: Vodafone
Accepted Solution

I have to add APN details in TCP connection

Hello,

I made an application on OS 4.5, while creating connection to server i have to add APN details.

I add APN details in that as 

url +=";deviceside=true;"+apn; 

 where, apn = "apn=intternet".

Now i am unable to hit server. Please let me know what should i do.

 

I was following method provided by forum, Since no username and password needed in mine case.

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

Re: I have to add APN details in TCP connection

"Now i am unable to hit server"

 

What happens when you try?

 

""apn=intternet"."

 

That is unusual - which carrier are you on?

Developer
Posts: 98
Registered: ‎08-17-2010
My Device: BlackBerry 8300 simulator
My Carrier: Vodafone

Re: I have to add APN details in TCP connection

I am hitting for vodacom server SA.

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

Re: I have to add APN details in TCP connection

[ Edited ]

There were two questions in my previous post.  Can you answer the first one too?

 

Edit:

 

Also check your APN settings, "apn=intternet" looks wrong to me.

Developer
Posts: 98
Registered: ‎08-17-2010
My Device: BlackBerry 8300 simulator
My Carrier: Vodafone

Re: I have to add APN details in TCP connection

Sorry, That was "apn=internet".

that is giving me response code 403 (forbidden)

 

I am trying to connect to server withAPN details (provided by vodacom).

They want me to put APN credentails (no username password needed)in each connection, without APN i am getting proper response, but with APN i am getting 403.

 

I am using "deviceside=true" for each connection and add "apn=internet" at last, Is this right?

 

 

Regards,
Ajit Sharma
Developer
Posts: 98
Registered: ‎08-17-2010
My Device: BlackBerry 8300 simulator
My Carrier: Vodafone

Re: I have to add APN details in TCP connection

As per vodacom they are not getting any hit on their server, but when i remove APN settings they are able to get request.
Regards,
Ajit Sharma
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: I have to add APN details in TCP connection

According to the vodacom informaiton that I have seen you need to specify the user - as guest.

 

Can you tell which 'server' is returning the 403?  Usually there is some Server informaiton in the headers returned, so you can dump these out and it might help. 

 

 

Developer
Posts: 98
Registered: ‎08-17-2010
My Device: BlackBerry 8300 simulator
My Carrier: Vodafone

Re: I have to add APN details in TCP connection

Hi,

Thanks for reply, i am able to connect to server with details "apn=internet;tunnelauthusername=guest;"

as shown on link, but some time my application is not able to connect to server and some time working proper.

Is there any problem with my APN setting?

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

Re: I have to add APN details in TCP connection

I presume you have specified "apn=internet;tunnelauthusername=guest;" for every request (ones that fail and ones that don't), but can you please confirm this?

 

Can you also confirm that you append this correctly? 

 

Remember that the ";" separates the URL from the connection suffix and every parameter of the connection suffix is separated from the preceding parameter also with a ";".  So I suspect most people would say the connection suffix to use in your case was actually:

";apn=internet;tunnelauthusername=guest"

 

Now getting on to your real concern:

"my application is not able to connect to server and some time working proper"

 

The information presented is not enough for us to speculate on what the problem is.  It could simply be that you go out of network cover.  It could be that some of your requests are badly constructed and so you get an error code from your Server.  It could also be that your application does not recognize the data that is coming back from the Server in some cases. 

 

Unfortunately you are going to have to investigate the failing connections and determine what actually happened.  You will be looking for exceptions in the network processing or your processing, or unexpected error responses. 

 

Until you do this and provide more information, we can't really help you.

 

Developer
Posts: 98
Registered: ‎08-17-2010
My Device: BlackBerry 8300 simulator
My Carrier: Vodafone

Re: I have to add APN details in TCP connection

Thank you guys for your response i got solution for my problem.

That was with APN setting. i was adding that with a semicolon but actual APN should

apn=internet;tunnelauthusername=guest

 

when i add that, my problem was solved.

 

Now i have one more problem in same, for that i will create another thread

Regards,
Ajit Sharma