08-29-2012 05:36 AM
Hi, I'm dealing along several days with a problem, bug...whatever you want.
The fact is that I'm trying to stablish an HttpConnection (POST) througt BES with a BlackBerry device (8900 & 9360) and I can't sent properly the parameter 'Host' as a requestProperty because this request property seems to be interpreted by an intermediate server before reach the final server and then, well, to resume, wrong things happens, you can imagine...
Specifically, I'm trying to send 'Host' as 'httpConnection.setRequestProperty("Host", "localhost");'. It seems that an intermediate server (or my own BlackBerry) read it and do something with it and then I get in the BlackBerry an http error code 400 and the response 'Connection refused localhost:80'. If I don't send this parameter the request reach the final server I want (but it fails there, because of implementation needs I must sent the parameter).
Does it exist any way in which the request parameters are passed to the final server (as it must be) whitout being interpreted along the way? Do you have any idea of how to solve my problem?
By the way with direct TCP connection (deviceside=true) all works fine, so the 'problem' should be inside the RIM network. Regrettably, connections must go thought BES, so this is not an option.
Thanks in advance
08-29-2012 04:36 PM
Hi @yokese,
Try adding the following to your request:
conn.setRequestProperty("x-rim-transcode-content", "none");
Hope that helps,
E.
08-30-2012 05:03 AM
Many thanks, but that is one request property I've included before and don't solve it....
08-30-2012 08:16 AM - edited 08-30-2012 08:17 AM
Can you post your code?
Can you try and use the real hostname / IP as the host value?
E.
09-01-2012 12:35 PM
Well, thank you for your help.
About the code I think it'is fine, it's all about an issue in the RIM network that one RIM proxy read the http request parameter 'Host' and then redirect the query there. We've coded a simple 'proxy' in java inside our network to which we make initially our http request (setting 'Host' to it). This proxy rewrites de 'Host' parameter to localhost value and then redirect the request to the final server.
Once more time RIM knows know how to make things difficult to developpers....