Hello,
Out company has just developed a j2me program for sales personal to place order from mobile phone. The program is developed using netbeans 6. The connection to the the server is using http protocol via gprs or 3G.
There is a problem that we face; sometimes we there are duplicate entries from the one mobile request. For example, A sales personal placed an order and press the send button to the server.. The server incoming log sometimes will have multiple request from this this request..
public void send()throws IOException
{
//mainS = null;
Days = "";
if (mainS == null){
getAlert1().setString("Invalid Input lala");
throw new IOException("Invalid Input lala");
}
String onum = getonum();
StringBuffer b = new StringBuffer();
String url = server + "?act=i&unm=" + uname + "&upw=" + upw + "&icode="Icode"&onum="+onum "&dd=" getDates() + "&num=" + mainS;
System.out.println(url);
try{
//Connect to the server
HttpConnection hc = (HttpConnection) Connector.open(url);
//Authentication
System.out.println(hc.getResponseCode());
if (hc.getResponseCode() == HttpConnection.HTTP_OK) {
InputStream is = hc.openDataInputStream();
int ch;
while((ch = is.read()) != -1) {
b.append((char) ch);
}
System.out.println(b.toString().trim());
returnS = b.toString().trim();
is.close();
}else{
getAlert1().setString("No respon from server.");
hc.close();
throw new IOException("No respon from server.");
}
hc.close();
}catch(Exception ex){
getAlert1().setString(ex.getMessage());
throw new IOException(ex.getMessage());
}
}
Please help.
Rgds.
Kok

Reply With Quote



