来自Web服务Ksoap的数据发生的错误

时间:2013-05-03 10:37:01

标签: android web-services ksoap

在ksoap对象

中从Internet请求数据时发生

错误

    public String[] getProfile(String email) {

    String[] profileArray = new String[3];
    METHOD_NAME = "getProfile";
    SoapObject getprofileSoapObject = new SoapObject(NAMESPACE,METHOD_NAME);
            //To avoid code duplication getproperty. Set info

    getprofileSoapObject.addProperty(setProperty("email", email));

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(getprofileSoapObject);

    HttpTransportSE http = new HttpTransportSE(URL);
    try { //call httptransport
        http.call(SOAP_ACTION, envelope);

        SoapObject  SoapObject2 = (SoapObject) envelope.bodyIn;

        //Set  profile detail
        profileArray[0] =  SoapObject2.getProperty(0).toString();
        profileArray[1] =  SoapObject2.getProperty(1).toString();
        profileArray[2] =  SoapObject2.getProperty(2).toString();
        return profileArray;
    } catch (Exception e) {
        //System.out.println(e.getMessage());

    }
    return profileArray;
}

http.call

后发生NullPointerException错误

0 个答案:

没有答案