in Education by
If I am trying to retrieve first array using (String) response.getProperty(0); but it was returning me a full string. **Here is the code of webservice calling** public static Object getResponse(String methodName, String actionName, LinkedHashMap valueStrings) { SoapObject soapObject = new SoapObject(LetUsClickAPIConstants.COMMON_NAMESPACE, methodName); Object response = null; for (Map.Entry mapKeys : valueStrings.entrySet()) { soapObject.addProperty(mapKeys.getKey(), mapKeys.getValue()); } final SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = false; envelope.setOutputSoapObject(soapObject); final AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(LetUsClickAPIConstants.COMMON_URL); try { androidHttpTransport.call(actionName, envelope); response = envelope.getResponse(); Log.d("Response ", response.toString()); } catch (final IOException e) { Log.d("Exception", "" + e); } catch (final XmlPullParserException e) { Log.d("Exception", "" + e); } return response; } I got an response in Vector type [Client{UserId=93; nickName=ladies; }, Client{UserId=94; nickName=ABCD; }] I have tried many ways but I am not success to retrieve in any way? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Use FolloWing code.. Soapresponse = Ksoap.CallService("SOAP_METHOD_NAME); try { if (Soapresponse != null) { SoapObject Soapresult = (SoapObject) Soapresponse .getProperty(0); if (Soapresult != null) { SoapObject Dataset = (SoapObject) Soapresult .getProperty(1); if (Dataset != null) { SoapObject Table = (SoapObject) Dataset .getProperty(0); if (Table != null) { UserId= new String[Table.getPropertyCount()]; nickName= new String[Table .getPropertyCount()]; for (int i = 0; i < total_News; i++) { SoapObject row = (SoapObject) Table .getProperty(i); UserId[i] = row.getProperty("UserId") .toString(); nickName[i] = row.getProperty( "nickName").toString(); } } } } } } catch (NullPointerException f) { } catch (ClassCastException d) { }

Related questions

0 votes
    If I am trying to retrieve first array using (String) response.getProperty(0); but it was returning me ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    For four days now I´ve been trying to perform a query in my database. Heres the problem: I have a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    I have to retrieve Derived class objects stored in a Map given the respective class name as key. As ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    I have to retrieve Derived class objects stored in a Map given the respective class name as key. As ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    In the HTML of a web app, there is the following code What is actually shown on the page is a string displaying ... . Any help? Thanks. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I store all of the Google Maps marker objects in a single array. Right now I am trying to set up ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    If I have a "Bill" entity, I might create that bill instance via REST API by assigning the food ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    If I have a "Bill" entity, I might create that bill instance via REST API by assigning the food ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I try to merge some object into one array I did output by q = [["99","99","99"],["9" ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
0 votes
    I was unable to find a solution that is identical with the issue I am trying to solve. If is a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I was unable to find a solution that is identical with the issue I am trying to solve. If is a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    i have an array of objects in [ { "country": "USA", "payment": [ { "paymentType": "Visa" ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    I am trying to sort an array of objects by the name field but the ordering is wrong. The order I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 5, 2022 in Education by JackTerrance
0 votes
    What happens with the objects if the array is released?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Suppose that you have an array consisting of several objects. This object is of the type string. Let this string be ... the character array arr'. How will you carry this out?...
asked Oct 16, 2020 in Technology by JackTerrance
...