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
soonthor
Posts: 25
Registered: ‎07-02-2008
My Device: Not Specified
Accepted Solution

HttpConnection support for "transfer-encoding: chunked" header

Hi,

 

I'm testing HTTPConnection on both simulator and Perl8100. It doesn't seem to support sending a HTTP request with "transfer-encoding: Chunked" header. The HttpConnection.getOutputStream().write() doesn't seem to send data to a server right away. It seems to me that the data will be sent once the outputStream is closed. Also, the "Content-length" header is implicitely added within the implementation of HTTPConnection.

 

Is there a trick to turn on  "transfer-encoding: Chunked" support? Or it just not support?

 

Thank you for your help.

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: HttpConnection support for "transfer-encoding: chunked" header

What route is your connection being made over?

 

What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
soonthor
Posts: 25
Registered: ‎07-02-2008
My Device: Not Specified

Re: HttpConnection support for "transfer-encoding: chunked" header

Hi,

 

Thank you for your reply. About which route I use, I'm not sure. I just call (HttpConnection)Connector.open("http://ip:smileytongue:ort/path"). Per your document link, since I don't specify "deviceside". I think it's MDS.

 

Anyway, this is on Perl8100 with AT&T. When I go to Settings, Options, Advanced Options, MDS Activation, the status is "Not Activated". Also, under "TCP" option,  APN, username and password are prefilled. So, it means I'm using direct TCP, not MDS?  I'm confused.

 

 

I also have another question. That's I think it relates.  I try (SocketConnection)Connector.open("socket://ip:8080"). When I run it on the same device, it just says "Cannot connect to 8080".  How come HttpConnection can connect but not SocketConnection.  I'm lost.

 

Thank you for your help at this matter.

 

 

 

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: HttpConnection support for "transfer-encoding: chunked" header

The not activated means that MDS Runtime is not activated on a BlackBerry Enterprise Server.  This would prevent you from using MDS Runtime applications created in MDS Studio (not relevant here).

 

I recommend trying the deviceside parameter to control what connection type you are making.

 

Is your HTTP and socket connection connecting to the same destination?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
soonthor
Posts: 25
Registered: ‎07-02-2008
My Device: Not Specified

Re: HttpConnection support for "transfer-encoding: chunked" header

Hi Mark,

 

Yes, both HTTP and Socket connect to the same server and port.

 

I just tried explicitely set "deviceside=false" as well as "deviceside=true".

 

For HttpConnection, when I add "deviceside" string, it just fails. Invalid url parameter. Here is the url I pass in http://ip:8080;deviceside=false/BBTest/BBServlet.  Is it correct? Or should I put ";deviceside=false" at the end.

 

For SocketConnection, they all fail. Cannot open socket connection on port 8080.

 

Do you know if it has something to do with AT&T? My test has is not signed with BB certificate since those calls are not controlled API. Do I have to always sign BB cert? How about AT&T, do I need to sign any certificate with them?

 

Again, I really appreciate your help.

 

 

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: HttpConnection support for "transfer-encoding: chunked" header

The ;deviceside=true/false parameter should go at the very end of the URL.  You can use this for both socket and HTTP connections.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
soonthor
Posts: 25
Registered: ‎07-02-2008
My Device: Not Specified

Re: HttpConnection support for "transfer-encoding: chunked" header

Okay. For HttpConnection, I tried adding ;deviceside=true/false parameter at the end of url. 

";deviceside=true" run okay. However, ";deviceside=false" gives me "Invalid url parameter".  Any idea why? 

 

For SocketConnection, do you think it's possible that AT&T block SocketConnection usage?

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: HttpConnection support for "transfer-encoding: chunked" header

This means that your BlackBerry is not configred for the Mobile Data Service on a BlackBerry Enterprise Server.

 

I recommend contacting AT&T to see what they allow using the APN you have configured and the APN(s) that your account has access to use.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: HttpConnection support for "transfer-encoding: chunked" header

I just successfully ran a SocketConnection on my AT&T 8800 with "deviceside=true", so AT&T doesn't seem to be blocking socket connections.  Did you say that "deviceside=true" works for you?  If so, is this issue resolved?  "deviceside=false" won't work unless you have BES, so that's working as expected.
Developer
soonthor
Posts: 25
Registered: ‎07-02-2008
My Device: Not Specified

Re: HttpConnection support for "transfer-encoding: chunked" header

Hi Richard and Mark,

 

Both ";devices=true/false" don't work for me. I think Mark is right. It might have something to do with APN setting. I'll check with AT&T.

 

One of my co-worker has 8800. HttpConnection doesn't even work for him. Under Setting,options, Advanced options, TCP, his APN, username, password are blank.   On my device, I have

APN: Wap.cingular

Username: WAP@CINGULARGPRS.com

Password: *****

I guess I really need to check with AT&T what kinds of access I have, huh?

 

Do you guys know where I can learn more about APN? How manay types? Can it be enable automatically when installing a third party application?

 

Thank you for your help.