Error in reading webservice result using KSoap library in android

前端 未结 1 741
感动是毒
感动是毒 2021-01-28 03:46

I am using Ksoap library to read xml from a webservice.Following is my code that i have used :

private static String SOAP_ACTION_Transaction = \"http://tempuri.o         


        
相关标签:
1条回答
  • 2021-01-28 04:18
    SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
    String responseLocal = resultsRequestSOAP.toString();
    

    Try the above instead of resultRequestSOAP = (SoapObject) envelope.getResponse();

     if (envelope.bodyIn instanceof SoapFault) {
        String str= ((SoapFault) envelope.bodyIn).faultstring;
        Log.i("", str);
    } else {
        SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
        Log.d("WS", String.valueOf(resultsRequestSOAP));
    }
    

    Alternatively if your response is primitive try

     SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
    
    0 讨论(0)
提交回复
热议问题