java.lang.ClassCastException:org.ksoap2.serialization.SoapObject在android中

java.lang.ClassCastException:org.ksoap2.serialization.SoapObject在android中,java,android,mysql,ksoap2,android-ksoap2,Java,Android,Mysql,Ksoap2,Android Ksoap2,嗨,我已经开发了一个android应用程序 该应用程序的目的是从mysql数据库中检索数据并在android设备中显示 这是我的android代码: public class RetailerActivity extends Activity { private final String NAMESPACE = "http://ws.testprops.com"; private final String URL = "http://krish.jelastic.servint.net

嗨,我已经开发了一个android应用程序

该应用程序的目的是从mysql数据库中检索数据并在android设备中显示

这是我的android代码:

public class RetailerActivity extends Activity {
 private final String NAMESPACE = "http://ws.testprops.com";
    private final String URL = "http://krish.jelastic.servint.net/Retrieve/services/Fetch?wsdl";
    private final String SOAP_ACTION = "http://ws.testprops.com/customerData";
    private final String METHOD_NAME = "customerData";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);

    HttpTransportSE ht = new HttpTransportSE(URL);
    try {
        ht.call(SOAP_ACTION, envelope);
        SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
        SoapPrimitive s = response;
        String str = s.toString();
        String resultArr[] = str.split("&");//Result string will split & store in an array

        TextView tv = new TextView(this);

        for(int i = 0; i<resultArr.length;i++){
        tv.append(resultArr[i]+"\n\n");
       }
        setContentView(tv);

    } catch (Exception e) {
        e.printStackTrace();
    }
}}
请帮助我。我如何解决此错误。

更改

SoapPrimitive response = (SoapPrimitive)envelope.getResponse();

改变


我已更改了上面的行,必须运行应用程序,这意味着我在模拟器上收到此消息:anyType{}为什么此处显示此anyType{}消息。如何解决此错误。请帮助meanytype{}:表示您没有从Web服务返回任何内容。您好,这是我的Web服务代码:这是我的wsdl链接:这只是正确的信息。那么为什么会出现antType{}错误。请为我提供解决方案。请检查您的Web服务代码。。我无法从webservice获取任何数据,请将异常处理更改为exc.printStackTrace();看看你有没有问题。当你将custinfo设置为“”时,我在我的mysql数据库上全局授予权限后得到了解决方案。首先,我必须在我的mysql数据库上设置授予的权限是静态的。这就是为什么我会出现上述错误。我已更改了上面的行,并且必须运行应用程序,这意味着我在模拟器上收到以下消息:anytype{}为什么在此处显示此anyType{}消息。我如何解决此错误。请帮助,意思是类型{}:表示您没有从Web服务返回任何内容。您好,这是我的Web服务代码:这是我的wsdl链接:这只是正确的信息。那么为什么要获取antType{}错误。请给我解决方案。他们检查您的Web服务代码。。我无法从webservice获取任何数据,请将异常处理更改为exc.printStackTrace();看看你有没有问题。在我必须对mysql数据库全局授予权限之后,我得到了解决方案。首先,我必须在mysql数据库上设置授予的权限是静态的。这就是为什么我会出现上述错误。
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
SoapObject response = (SoapObject)envelope.getResponse();