I have a web service method which returns ArrayOfString. I have to call that web service method from android app. But the code I have written so far is not working. It gives ClassCastException.
SoapObject request = null;
Object response = null;
String[] responseStr;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.encodingStyle = SoapSerializationEnvelope.ENC2003;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
int Timeout = 15 * 1000;
HttpTransportSE httpTransport = new HttpTransportSE(
Common.SOAP_ADDRESS, Timeout);
httpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
try {
request = new SoapObject(Common.WSDL_TARGET_NAMESPACE,
Common.OPERATION_NAME_GET_RESPONDENT_TYPE);
envelope.setOutputSoapObject(request);
httpTransport.call(Common.SOAP_ACTION_GET_RESPONDENT_TYPE,envelope);
response = envelope.getResponse();
responseStr = (String[]) response;
return responseStr;
} catch (Exception e) {
e.printStackTrace();
return null;
}
What's wrongs with my code? And how to do this? Thanks in advance.