我正在使用 Web 服务在数据库中存储多个值。我已经创建了代码,但无法将值存储在远程数据库中。代码中没有错误,但值没有存储在数据库中。
这是我的代码:-
public String registerDoctor(String MethodName,Pojo p)
{
try
{
SOAP_ACTION = namespace + MethodName;
//Adding values to request object
request = new SoapObject(namespace, MethodName);
PropertyInfo registerDoctors =new PropertyInfo();
//doctor name
Log.v("name", p.getDoctorName().toString());
registerDoctors.setName("doctorName");
registerDoctors.setValue(p.getDoctorName());
registerDoctors.setType(string.class);
//doctor qualification
Log.v("qualification", p.getQualification().toString());
registerDoctors.setName("qualificaion");
registerDoctors.setValue(p.getQualification());
registerDoctors.setType(string.class);
//doctor specialization
Log.v("specialization", p.getSpecialization().toString());
registerDoctors.setName("specialization");
registerDoctors.setValue(p.getSpecialization());
registerDoctors.setType(string.class);
//doctor cityId
Log.v("cityid", p.getCityId().toString());
registerDoctors.setName("cityId");
registerDoctors.setValue(p.getCityId());
registerDoctors.setType(integer.class);
//doctor areaId
Log.v("areaid", p.getAreaId().toString());
registerDoctors.setName("doctorName");
registerDoctors.setValue(p.getAreaId());
registerDoctors.setType(integer.class);
//doctor phoneNo
Log.v("phone", p.getPhoneNo().toString());
registerDoctors.setName("phoneNo");
registerDoctors.setValue(p.getPhoneNo());
registerDoctors.setType(string.class);
//doctor mobile1
Log.v("mobile1", p.getMobile().toString());
registerDoctors.setName("mobile1");
registerDoctors.setValue(p.Mobile);
registerDoctors.setType(string.class);
//doctor mobile2
Log.v("mobile2", p.getMobile2().toString());
registerDoctors.setName("mobile2");
registerDoctors.setValue(p.getMobile2());
registerDoctors.setType(string.class);
request.addProperty(registerDoctors);
SetEnvelope();
try
{
//SOAP calling webservice
androidHttpSE.call(SOAP_ACTION, envelope);
//Got Webservice response
String result = envelope.getResponse().toString();
Log.v("add log", result);
return result;
}
catch (Exception e)
{
// TODO: handle exception
return e.toString();
}
}
catch (Exception e)
{
// TODO: handle exception
return e.toString();
}
}