07-24-2008 03:35 PM
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.
Solved! Go to Solution.
07-25-2008 11:31 AM
What route is your connection being made over?
What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396
07-25-2008 12:11 PM
Thank you for your reply. About which route I use, I'm not sure. I just call (HttpConnection)Connector.open("http://iport/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
Thank you for your help at this matter.
07-25-2008 12:17 PM
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?
07-25-2008 03:18 PM
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.
07-25-2008 03:43 PM
07-25-2008 04:32 PM
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?
07-25-2008 04:34 PM
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.
07-25-2008 05:21 PM
07-25-2008 05:36 PM
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
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.