void loginajax(String sfunction, String susername, String suserpass) async{
String requestBody = "";
String ssss = "";
ssss = generateMd5("666666").toUpperCase();
//print(ssss);
requestBody += "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
requestBody += "<soap:Envelope xmlns
si=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns
sd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">";
requestBody += "<soap:Body>";
requestBody += "<" + sfunction + " xmlns=\"" + Constant.KHAPPURL + "/\">";
requestBody += "<scorp_id>" + "000001" + "</scorp_id>";
requestBody += "<scorp_password>" + ssss+ "</scorp_password>";
requestBody += "</" + sfunction + ">";
requestBody += "</soap:Body>";
requestBody += "</soap:Envelope>";
http.Response response = await http.post(
Constant.KHAPPURL + "/webappsrv.asmx",
headers: {
"SOAPAction": Constant.KHAPPURL + sfunction,
"Content-Type": "text/xml;charset=UTF-8",
"Authorization": "Basic bWVzdHJlOnRvdHZz",
"cache-control": "no-cache"
},
body: utf8.encode(requestBody),
encoding: Encoding.getByName("UTF-8")
).then((onValue)
{
print("Response status: ${onValue.statusCode}");
//print("Response body: ${onValue.body}");
//Response status: 200
//{"respcode":"0","errcode":"1001","respmsg":"APP参数校验非法!"}
String sresp = onValue.body;
sresp = sresp.replaceAll("<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns
si=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns
sd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><" + sfunction + "Response xmlns=\"" + Constant.KHAPPURL + "\"><" + sfunction + "Result>", "");
sresp = sresp.replaceAll("</" + sfunction + "Result></" + sfunction + "Response></soap:Body></soap:Envelope>", "");
ToastUtil.show(sresp);
});
}