Java program to send sms by accessing way2sms.com site.it woks correct for login,and login successfully ,but shows error while sending sms.
What I have tried:
I tried by changing url as well,bt it not working...
here is the method,
private void getActionString()
{
URLConnector.connect("http://" + site + "/jsp/InstantSMS.jsp", false,
"GET", cookie, null);
responseCode = URLConnector.getResponseCode();
System.out.println(responseCode);
System.out.println(HttpURLConnection.HTTP_MOVED_TEMP);
System.out.println(HttpURLConnection.HTTP_OK);
if (responseCode == HttpURLConnection.HTTP_MOVED_TEMP
|| responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_MOVED_PERM) {
String str = URLConnector.getResponse();
String aStr = "name=\"Action\" id=\"Action\"";
int aStrLen = aStr.length();
int index = str.indexOf(aStr);
System.out.println(str);
System.out.println(aStr);
if (index > 0) {
str = str.substring(index + aStrLen);
index = str.indexOf("\"");
if (index > 0) {
str = str.substring(index + 1);
index = str.indexOf("\"");
if (index > 0)
actionStr = str.substring(0, index);
//actionStr="one";
}
}
} else{System.out.println(actionStr); exit("getActionString failed!");}
URLConnector.disconnect();
}