j2me Http Post problems with IIS 6.0

Hi,

I have developed a system where a j2me midlet sends some post data to a php page running under IIS.

The system works fine under IIS 5.x but get a errorcode 400 on IIS 6.0

Any idea please ?

I think some special settings in IIS 6.0 is responsible for this.

If you are interested , the j2me sender is doing the followings :

http = (HttpConnection) Connector.open(URL);

String agent = "Profile/MIDP-2.0, Configuration/CLDC-1.1";

String rawData = "orders="+codes+"&cust="+cust_code.getString()+"&mob="+mobileNo;

rawData+="&dist_cd="+dist_code.getString()+"&thana_cd="+thana_code.getString()+"&union_cd="+union_code.getString()+"&sale_type="+sales_type.getString();

String type = "application/x-www-form-urlencoded";

// set the request method as POST

http.setRequestMethod(HttpConnection.POST);

http.setRequestProperty( "User-Agent", agent );

http.setRequestProperty( "Content-Type", type );

http.setRequestProperty("Content-Language","en-US");

http.setRequestProperty( "Content-Length", Integer.toString(rawData.length()));

OutputStream os = http.openOutputStream();

os.write( rawData.getBytes() );

//http.setRequestMethod(HttpConnection.GET);

// server response

int i;

if ((i=http.getResponseCode()) == HttpConnection.HTTP_OK)

{

sb = new StringBuffer();

int ch;

is = http.openInputStream();

while ((ch = is.read()) != -1)

sb.append((char) ch);

reply=sb.toString();

}

-

Please help :(

Thanks in advance.

Mahmudul Alam Dipu

[1659 byte] By [dipua] at [2007-11-27 8:12:27]
# 1
With IIS 6.0 MS added a new setting to the metabase that limits the size of a request. See http://classicasp.aspfaq.com/forms/what-is-the-limit-on-form/post-parameters.html for details. It may be that your post data exceeds the default limit imposed by IIS 6.0.
Gexa at 2007-7-12 19:56:49 > top of Java-index,Java Mobility Forums,Java ME Technologies...