I want to use the latitude longitude information from the XML output of a web service in an android app.
I get the output as follows: This XML file does not appear to have any style information associated with it. The document tree is shown below.
<string xmlns="http://ift.tt/18TcHUI">
<NewDataSet> <Table> <AirportCode>MSP</AirportCode> <CityOrAirportName>MINNEAPOLIS INTL</CityOrAirportName> <Country>United States</Country> <CountryAbbrviation>US</CountryAbbrviation> <CountryCode>63</CountryCode> <GMTOffset>6</GMTOffset> <RunwayLengthFeet>10000</RunwayLengthFeet> <RunwayElevationFeet>841</RunwayElevationFeet> <LatitudeDegree>44</LatitudeDegree> <LatitudeMinute>54</LatitudeMinute> <LatitudeSecond>0</LatitudeSecond> <LatitudeNpeerS>N</LatitudeNpeerS> <LongitudeDegree>93</LongitudeDegree> <LongitudeMinute>13</LongitudeMinute> <LongitudeSeconds>0</LongitudeSeconds> <LongitudeEperW>W</LongitudeEperW> </Table> <Table> <AirportCode>MSP</AirportCode> <CityOrAirportName>MINNEAPOLIS INTL</CityOrAirportName> <Country>United States</Country> <CountryAbbrviation>US</CountryAbbrviation> <CountryCode>63</CountryCode> <GMTOffset>6</GMTOffset> <RunwayLengthFeet>10000</RunwayLengthFeet> <RunwayElevationFeet>841</RunwayElevationFeet> <LatitudeDegree>44</LatitudeDegree> <LatitudeMinute>54</LatitudeMinute> <LatitudeSecond>0</LatitudeSecond> <LatitudeNpeerS>N</LatitudeNpeerS> <LongitudeDegree>93</LongitudeDegree> <LongitudeMinute>13</LongitudeMinute> <LongitudeSeconds>0</LongitudeSeconds> <LongitudeEperW>W</LongitudeEperW> </Table> </NewDataSet>
</string>
I am getting this in the form of a SOAP object in the following code:
private static String SOAP_ACTION = "http://ift.tt/1I0McLL";
private static String NAMESPACE = "http://ift.tt/18TcHUI";
private static String METHOD_NAME = "getAirportInformationByAirportCode";
private static String URL = "http://ift.tt/1vl3ZTE";
public String source_textview, destination_textview;
//Initialize soap request + add parameters
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//Use this to add parameters
request.addProperty("airportCode",airportCode);
//Declare the version of the SOAP request
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
// Get the SoapResult from the envelope body.
SoapObject result = (SoapObject)envelope.bodyIn;
Now I want to extract the latitude and longitude from the XML. Can someone help me.
No comments:
Post a Comment