Note that there are some explanatory texts on larger screens.

plurals
  1. POSOAP-Request with Vector, Cast-Error
    primarykey
    data
    text
    <p>I've a problem with a SOAP request to a PHP-SOAP-Webservice with Java (with Android SDK) I have a SOAP-Helper class. This class connects to the SOAP-Service and get all raw-data from the server. In this class i've implemented the following method:</p> <pre><code>@SuppressWarnings("unchecked") public static Vector&lt;SoapObject&gt; getLayers(){ try { final String SOAP_ACTION = "http://www.XYZ.ch/YYY/webservice.php/getLayers"; final String METHOD_NAME = "getLayers"; SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); androidHttpTransport.call(SOAP_ACTION, soapEnvelope); Vector&lt;SoapObject&gt; result = (Vector&lt;SoapObject&gt;)soapEnvelope.getResponse(); return result; } catch (Exception e) { return null; } } </code></pre> <p>Then I have a class which gets the data from the helper-class. here is the class for the layers.</p> <pre><code>public void getLayers(){ Vector&lt;SoapObject&gt; vectorLayers = SOAPHelper.getLayers(); ArrayList&lt;HashMap&lt;String, Object&gt;&gt; myList = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;(); for(int i=0; i&lt;vectorLayers.size(); i++){ HashMap&lt;String, Object&gt; layers = new HashMap&lt;String, Object&gt;(); layers.put("layerId", vectorLayers.get(i).getProperty(0)); layers.put("layerName", vectorLayers.get(i).getProperty(1)); myList.add(layers); } } </code></pre> <p>Now I have this cast error:</p> <pre><code>05-02 13:11:56.866: ERROR/AndroidRuntime(988): Caused by: java.lang.ClassCastException: java.util.Vector </code></pre> <p>With the debugger, i see all data in the Vector. The vector isn't empty. All data are correct.</p> <p>Any ideas?</p> <p>Thank you rob</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload