Help - Device set MimeType
Hi,
I develop a java application, that open a HttpConnection. Application run in BlackBarry 7230 handleld. In code I set MimeType by c.setRequestProperty(PROP_CONTENT_TYPE, "text/xml" ), but server receive "application/x-www-form-urlencoded" MimeType. Why? Thanks for any suggestion. fabius -- Fabio Maggi www.funambol.com 643 Bair Island Road, Suite 210 Via dei Valtorta 21 Redwood City, CA 94063 (USA) 20127 Milano (Italy) Sync4j - the open source SyncML mobile application platform - www.sync4j.org |
Are you doing a POST or a GET?
|
POST.
Thanks. fabius |
I assume you figured out this one?
|
Hi eradis,
actually, we haven't figured out it at all... we are getting more pessimistinc about BB is giving real support for HTTP. We did a test with the following code: ... (HttpConnection)Connector.open("http://server:8080/sync4j/sync;WAPGatewayIP=x.x.x.x;WAPGatewayAPN=something; WAPGatewayPort=9201", Connector.READ_WRITE, true); c.setRequestMethod(HttpConnection.POST); c.setRequestProperty("User-Agent" , "BlackBerry/3.6.1" ); c.setRequestProperty (PROP_CONTENT_TYPE , "application/vnd.syncml+xml" ); c.setRequestProperty (PROP_CONTENT_LENGTH , String.valueOf(length) ); os = c.openOutputStream(); for (int i = 0; i < l; i++) { os.write(requestArray[i]); } os.flush(); os.close(); os = null; ... and we looked at the GW log. It receives the formencode mimetype, regardless what we specify in the connection object. This prevents the BB to make, for example, SyncML calls, which is badly enough. :cry: Any suggestion? |
All times are GMT -5. The time now is 06:49 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.