该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
public class JLWMS {
private static String nameSpace = "http://tempuri.org/";
public static String Login1(String user,String pwd)
{
String message ="";
String urlstr = "http://192.168.15.242:8080/Service1.asmx";
String methodName = "login";
String soapAction = "http://tempuri.org/login";
try {
SoapObject so = new SoapObject(nameSpace, methodName);
so.addProperty("uid", user);
so.addProperty("pwd", pwd);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
AndroidHttpTransport at = new AndroidHttpTransport(urlstr);
envelope.dotNet = true;
envelope.setOutputSoapObject(so);
at.call(soapAction, envelope);
if (envelope.getResponse() != null) {
SoapObject result = (SoapObject) envelope.bodyIn;
SoapObject detail = (SoapObject) result.getProperty("Login1");
message = detail.getProperty(1).toString();
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("--------------------------"+message);
return message;
}
}
代码贴出求大神指导下