Hello Friends i am using soap web services very first time in my code. but i am not getting how to handle nested soap objects. this is my code
private final String URL = "http://192.168.0.20/BookingEngineService/HotelBookingService.asmx";
private final String SOAP_ACTION = "http://tempuri.org/AndroidTestRequest";
private final String METHOD_NAME = "AndroidTestRequest";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("User", "abcd@xyz.com");
request.addProperty("Password", "abcd@123");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.headerOut = new Element[1];
envelope.headerOut[0] = buildAuthHeader();
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
Log.i("myAppEnvelope", envelope.toString());
SoapObject response = (SoapObject) envelope.getResponse();
// here i am trying to get values from response which is soap object
for (int i = 0; i < response.getPropertyCount(); i++) {
SoapObject con = (SoapObject) response.getProperty(i);
Log.e("Continent", con.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
i am getting soap object as a response and which is very complex so i am not getting how to parse it. this is my response this is very small part of my response.
I am not getting how to get values from SoapObject -> Properties -> elementData -> value-> property -> elementData and so on ... its too complex please help me.