sending to soap not worinkg
I have android code which has two integers variables getting from HashMap
Key , value .
i'm trying to pass these two variables to SOAP web service but nothing
happened .
notes 1: I'm sure my WebService code is working and entering the right
data to database , i have tested it .
note 2 : FROM debug shows that "SID" and "status" has right values .
but the problem in sending these values to SOAP .
FULL SOAP code in android Activity :
sumbit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
for (Map.Entry<Integer, Integer> mapEntry : checkBoxState
.entrySet()) {
int SID = mapEntry.getKey();
int status = mapEntry.getValue();
Toast.makeText(context,
String.valueOf(SID) + String.valueOf(status),
Toast.LENGTH_SHORT).show();
try {
SoapObject request = new SoapObject(NAMESPACE,
METHOD_NAME);
HttpTransportSE androidHttpTransport = new
HttpTransportSE(
URL);
PropertyInfo pi = new PropertyInfo();
pi.setName("SID");
pi.setValue(SID);
pi.setType(Integer.class);
request.addProperty(pi);
PropertyInfo pi2 = new PropertyInfo();
pi2.setName("status");
pi2.setValue(status);
pi2.setType(Integer.class);
request.addProperty(pi2);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
androidHttpTransport.call(SOAP_ACTION, envelope);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
FULL webService Method Code :
public void insertApsentData(int SID , int status ) throws SQLException,
ClassNotFoundException, ReflectiveOperationException, Throwable{
// Make new Connection to database .
Dbconnection NewConnect = new Dbconnection();
Connection con = NewConnect.MakeConnect();
Statement stmt = con.createStatement();
// this i'm usre is working fine
stmt.executeUpdate("INSERT INTO apsent SET course_id=1, teacher_id= 1 ,
class_id= 3 , interval_id= 5 , day_id = 1 , APSSENT_DATE = CURdate()
,state = " + status + ", student_id = " + SID +" ,school_id =
1;");//called the procedure
}
No comments:
Post a Comment