Hello All

Actually I am new to Android application development. I create java
client from a wsdl link by using Ksoap2 tool but there is problem that
I am not able to handel complex data type.

here is a code snipt :

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:soap12="http://
www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetModuleListResponse xmlns="http://tempuri.org/";>
      <GetModuleListResult>
        <ws_module>
          <module_id>int</module_id>
          <module_name>string</module_name>
        </ws_module>
        <ws_module>
          <module_id>int</module_id>
          <module_name>string</module_name>
        </ws_module>
      </GetModuleListResult>
    </GetModuleListResponse>
  </soap12:Body>
</soap12:Envelope>



//
******************************************************************************************************//


    public  org.tempuri.Ws_module[] getModuleList() throws Exception {

        methodName =  "GetModuleList";
        String soapAction = NAMESPACE + methodName;

        SoapObject _client = new SoapObject(NAMESPACE,
"GetModuleList");
        SoapSerializationEnvelope _envelope = new
SoapSerializationEnvelope                 (SoapEnvelope.VER11);
        _envelope.dotNet = true;
        _envelope.bodyOut = _client;
        AndroidHttpTransport _ht = new
AndroidHttpTransport(Configuration.getWsUrl());
        _ht.call(soapAction, _envelope);
        resultRequestSOAP =  (SoapObject)_envelope.getResponse();
        length = resultRequestSOAP.getPropertyCount();
        Ws_module[] module = new Ws_module[length];

        for (int i = 0; i < length; i++) {
                SoapObject so = (SoapObject)
resultRequestSOAP.getProperty(i);
                module[i] = (Ws_module)(so.getProperty(i));
        }
        return module;
    }



I am getting error class cast exception at

module[i] = (Ws_module)(so.getProperty(i));

here WS_module is a other class type

Can any buddy help me

Vaibhav

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to