它主要执行SQL。我下载断点。也许在句子中if (envelope.getResponse() != null)
它得到了空对象,所以它在返回空值后完成。我在SQL中监控,发现它没有执行SQL语句。比如:ht.call("http://toeye.net/" + MothodName, envelope);
它也没有在webservice中执行。
public static String sSQL(String SQL)
{
String MothodName = "ExecSQL";
HttpTransportSE ht = new HttpTransportSE("http://192.168.1.80/YFService.asmx?WSDL");
ht.debug = true;
// use SOAP1.1 creat Envelop object
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER12);
// instantiate SoapObject
SoapObject soapObject = new SoapObject("http://toeye.net/", MothodName);
soapObject.addProperty("SQLString", SQL);
envelope.bodyOut = soapObject;
// set the Web Service which applied by .Net and keep the compatibility
envelope.dotNet = true;
try
{
// call Web Service
ht.call("http://toeye.net/" + MothodName, envelope);
if (envelope.getResponse() != null)
{
// Access server response and return SOAP message
SoapObject result = (SoapObject) envelope.bodyIn;
SoapObject detail = (SoapObject) result.getProperty(MothodName
+ "Result");
// Analytic server response SOAP message
return detail.toString();
}
}
catch (IOException e)
{
e.printStackTrace();
}
catch (XmlPullParserException e)
{
e.printStackTrace();
}
return null;
}