0

It executes SQL mainly. I download the breakpoint. maybe in the sentence if (envelope.getResponse() != null)it get the null object, so it finish after return the value of null. I monitor in SQL, and find it did not execute SQL sentence.such as: ht.call("http://toeye.net/" + MothodName, envelope); It also did not execute in 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;
}
Li Che
  • 727
  • 10
  • 24

0 Answers0