0

how to iterate complex type of array in java

anyType{schema=anyType{element=anyType{complexType=anyType{choice=anyType{element=anyType{complexType=anyType{sequence=anyType{element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; }; }; }; }; }; }; }; diffgram=anyType{DocumentElement=anyType{default=anyType{guesttranunkid=1; guestunkid=1; phoneno=900000000; emailid=Piyush@mail.com; }; default=anyType{guesttranunkid=2; guestunkid=2; phoneno=992222222; emailid=ja@gmail.com; }; default=anyType{guesttranunkid=3; guestunkid=3; phoneno=9999999999; emailid=yuvi@gmail.com; }; default=anyType{guesttranunkid=4; guestunkid=4; phoneno=888888888; emailid=sachin@gmail.com; }; default=anyType{guesttranunkid=5; guestunkid=5; phoneno=111111111; emailid=DD@gmail.com; }; default=anyType{guesttranunkid=6; guestunkid=6; phoneno=3333333333; emailid=DD@gmail.com; }; default=anyType{guesttranunkid=7; guestunkid=7; phoneno=12121212; emailid=CSK@gmail.com; }; default=anyType{guesttranunkid=8; guestunkid=8; phoneno=1313131313; emailid=CSK@gmail.com; }; default=anyType{guesttranunkid=9; guestunkid=9; phoneno=1414141414; emailid=MI@gmail.com; }; default=anyType{guesttranunkid=10; guestunkid=10; phoneno=1515151; emailid=Devid@gmail.com; }; default=anyType{guesttranunkid=11; guestunkid=11; phoneno=16161616; emailid=Smith@gmail.com; }; }; }; }

Chirag Patel
  • 2,320
  • 3
  • 24
  • 38
user1153176
  • 1,006
  • 5
  • 15
  • 21

1 Answers1

2

You should check out this Tutorial for parsing such type of response

Web Service That Returns An Array of Objects With KSOAP

Another way for parsing is using JSONObject and JSONArray

Manual Parsing of an Array of SoapObjects into an POJO array

Community
  • 1
  • 1
Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242
  • but i still emphasis to change the server response if he can, because parsing Json is very easy compare to Soap and Xml. with the help Gson, Jackson Json parsed in number of second and easy to understand. Still +1 with your answer :) – Mohammed Azharuddin Shaikh Apr 10 '12 at 10:20
  • @hotveryspicy agree but we can't tell the user to change web-service as an answer, as an suggestion yes we can. – Lalit Poptani Apr 10 '12 at 10:23
  • @hotveryspicy you may be right, but we can't make client to develope his existing WS in json from SOAP...rather we should learn SOAP parsing.. – Chirag Patel Apr 10 '12 at 10:25
  • @hotveryspicy check my edited link, thats what you could have suggested :) – Lalit Poptani Apr 10 '12 at 10:27