0

I want to pass an Single Dimensional Double Array from VB.NET Web Service to Android Application.

Please tell me how to do it ?

2
  • you can use Arraylist with Hashmap.. Commented Jun 6, 2013 at 4:48
  • can you post some sample code ? Commented Jun 6, 2013 at 4:49

1 Answer 1

1
public ArrayList<HashMap<String, String>> getlogindata(String Tname,
            String col) {
        try {

            hmALData = new ArrayList<HashMap<String, String>>();

            SoapObject request = new SoapObject(NAMESPACE,
                    SOAP_METHOD_GETDATATBL);

            String ttnm = Tname.trim();

            request.addProperty("TName", ttnm);
            request.addProperty("ColumnNameStr", "*");

            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                    SoapEnvelope.VER11);

            envelope.dotNet = true;

            envelope.setOutputSoapObject(request);

            HttpTransportSE aht = new HttpTransportSE(URL, 60000);

            aht.call(SOAP_ACTION_GETDATATBL, envelope);

            SoapObject response = (SoapObject) envelope.bodyIn;

            System.out.println("Response : " + response);

            System.out
                    .println("ResponseCount : " + response.getPropertyCount());

            SoapObject con = (SoapObject) response.getProperty(0);

            System.out.println("REsult One: " + con.toString());

            SoapObject con1 = (SoapObject) con.getProperty(1);

            System.out.println("REsult One1: " + con1.toString());

            if (con1.toString().trim().equals("anyType{}")) {
                return hmALData;
            }
            SoapObject con2 = (SoapObject) con1.getProperty(0);

            System.out.println("REsult One2: " + con2.toString());
            System.out.println("one2 Count: " + con2.getPropertyCount());

            for (int i = 0; i < con2.getPropertyCount(); i++) {

                SoapObject con3 = (SoapObject) con2.getProperty(i);

                System.out.println("REsult Three: " + con3.toString());

                hmData = new HashMap<String, String>();
                if (con3 instanceof SoapObject) {
                    SoapObject getAll = (SoapObject) con3;


                    hmData.put("LoginId", getAll.getProperty("LoginId")
                            .toString());
                    hmData.put("Password", getAll.getProperty("Password")
                            .toString());


                    }

                hmALData.add(hmData);
            }

            return hmALData;
        } catch (SocketTimeoutException e) {
            return hmALData;
        }

        catch (IOException e) {
            System.out.println("IOException : " + e);
            e.printStackTrace();

        } catch (XmlPullParserException e) {
            System.out.println("XMLPullParserException : " + e);
            e.printStackTrace();
        } catch (RuntimeException e) {
            e.printStackTrace();
        }

        return hmALData;
    }
Sign up to request clarification or add additional context in comments.

1 Comment

I'll check it and will get back at you. Thanks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.