以下代碼顯示XML文件通過SOAP發送到服務器中,那麼如何把下面的xml文件轉換成KSOAP請求?
<location>
<locationId>132</locationId>
<name>test</name>
<qualifiedCoordinates>
<altitude>10</altitude>
</qualifiedCoordinates>
</location>
SoapObject request = new SoapObject(NAMESPACE, METHOD);
request.addProperty("locationId", 132);
request.addProperty("name", test);
request.addProperty("altitude", 10);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject result = (SoapObject) envelope.getResponse();}
catch(Exception e) {
tempText.setText("Error");
e.printStackTrace();
}