Problem display array from SOAP array

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Problem display array from SOAP array

Postby naturlight » Thu Feb 10, 2011 1:08 pm

Hello everybody,
I try to make my first android app !

I have a function witch return a object (resultRequestSOAP).
In the resultRequestSOAP there is an ARRAY of object.

Syntax: [ Download ] [ Hide ]
Using javascript Syntax Highlighting
  1.                         // FONCTION LISTALL
  2.           public Object listall(String session){
  3.             final String SOAP_ACTION = "http://www.nubio.net/soap/vps#listAll";
  4.             final String METHOD_NAME = "listAll";
  5.             final String NAMESPACE = "http://www.nubio.net/soap/vps";
  6.             final String URL = "http://www.nubio.net/soap/vps";
  7.        
  8.                 SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
  9.             //SoapObject
  10.             request.addProperty("session",session);
  11.             SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  12.             envelope.setOutputSoapObject(request);
  13.             HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
  14.             try
  15.                 {
  16.                         androidHttpTransport.call(SOAP_ACTION, envelope);
  17.                         resultRequestSOAP =  envelope.getResponse();
  18.                    
  19.             }
  20.             catch (Exception aE)
  21.                 {
  22.         aE.printStackTrace ();;
  23.                 }
  24.             return resultRequestSOAP;
  25.                
  26.         }
  27.         }
Parsed in 0.004 seconds, using GeSHi 1.0.8.4


I test the function to return string and it's works fine, but i need to show the array on the screen.
How can i display the array in the resultRequestSOAP; ?
But the original return of the soap in resultRequestSOAP; is :
Syntax: [ Download ] [ Hide ]
  1. array( 
  2. 0 => Object{ 
  3. vps_id : int 
  4. ip : string 
  5. hostname : string 
  6. password : string (optional) 
  7. os : string 
  8. os_arch : integer 
  9. os_distri : string 
  10. expire : string (DATE TIME) 
  11. }, 
  12. ... 


So i can i return the array from the soap and display it !?
I'm sorry for my english, i hope you could help me :)
The best for me will only display the "hostname string" from the array as button is it possible ?

Regards,
naturlight
Freshman
Freshman
 
Posts: 2
Joined: Thu Feb 10, 2011 1:03 pm

Top

Re: Problem display array from SOAP array

Postby naturlight » Sat Feb 12, 2011 7:01 pm

up
naturlight
Freshman
Freshman
 
Posts: 2
Joined: Thu Feb 10, 2011 1:03 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 6 guests