httprequest problem

Hi,

I have a httprequest problem and maybe some of you can help me. I do a request like this:


HttpGet httpGet = new HttpGet(url);

HttpParams params = new BasicHttpParams();
HttpConnectionParams.setSoTimeout(params, 30000);
HttpConnectionParams.setConnectionTimeout(params, 30000);
SchemeRegistry schemeRegistry = new SchemeRegistry();
			schemeRegistry.register(new Scheme("http", PlainSocketFactory
							.getSocketFactory(), 80));
ClientConnectionManager cm = new ThreadSafeClientConnManager(
							params, schemeRegistry);

HttpClient httpclient;
			
httpclient = AndroidHttpClient.newInstance("Android");
				
// Execute HTTP Get Request
HttpResponse response;

response = httpclient.execute(httpGet);
				
((AndroidHttpClient) httpclient).close();
				
InputStream is = AndroidHttpClient.getUngzippedContent( response.getEntity() );

Usual this request works as expected, I get an xml from the InputStream which I can parse afterwards.

But I have a user in south africa who doesn’t get a xml in response but something like this instead:


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://settings.vodacommi.co.za:8010/cacos/options.cgi?cahost=owbfe033&url=MYURL">here</a>.</p>
</body></html>

Ok, looks like a simpel redirection. That’s why I added this in the above code:


HttpClientParams.setRedirecting(httpclient.getParams(), true);

The redirection does work, I have tried it with the help of this page: http://jigsaw.w3.org/HTTP/300/

But my user from south africa still doesn’t get the right xml data after redirection.

Has anybody ever had this problem? Can anyone help me to solve it?
The same problem found here (with no solution): http://supportforums.blackberry.com/t5/Java-Development/VodaCom-SA-WAP2-Modified-data/td-p/544556

Or is anyone from south africe using vodacommi and can help me debugging? I don’t want to bother my user again and again and again :wink:

Cheers,
Wolfgang

I have people in ZA using WordHero without problems. It does JSON over http with headers set to DON’T CACHE. No idea if they are using Vodacom or not though.

for me, that looks like there is no true 302 returned, but a html site which does only send a link to another url … could be malware

on the other hand, the host “vodacommi.co.za” does not exist, so every redirection to it is pretty useless :slight_smile:

The problem is that ZA has very limited bandwidth… so they try cache the hell out of EVERYTHING.

Thank you for your answers! I’ll try the DON’T CACHE setting.