lingfeng0510/ksoap2-android

org.ksoap2.SoapFault cannot be cast to org.ksoap2.serialization.SoapObject

Opened this issue · 2 comments

SoapSerializationEnvelope envelope = new 
SoapSerializationEnvelope(SoapEnvelope.VER10);  

envelope.bodyOut = rpc;  
envelope.dotNet = true;  
envelope.setOutputSoapObject(rpc);  
HttpTransportSE transport = new HttpTransportSE(URL);       

try {  
    transport.call(soapAction, envelope);  
} catch (Exception e) {  
    e.printStackTrace();  
} 

SoapObject object = (SoapObject) envelope.bodyIn; 

the error is in the last sentence: 
AndroidRuntime(16615): java.lang.ClassCastException: org.ksoap2.SoapFault 
cannot be cast to org.ksoap2.serialization.SoapObject

how to solve it ? please.

btw, i use ksoap2-android V3.1.0


Original issue reported on code.google.com by qin...@gmail.com on 20 Nov 2013 at 1:59

I think the service is returning an exception. You must cast to SoapFault to 
see the error

if (envelope.bodyIn instanceof SoapFault)
{
    final SoapFault sf = (SoapFault) envelope.bodyIn;
    ... // Stuff
}

Original comment by d.chap...@gmail.com on 27 Jan 2015 at 4:35

The project is migrating to github. If you believe this issue is still valid 
and should be tracked please file a new issue at 
https://github.com/simpligility/ksoap2-android/issues



Original comment by mosa...@gmail.com on 7 Aug 2015 at 5:35

  • Changed state: AwaitingContribution