1

私はAndroidを初めて使用します。SOAPを介してサーバーに送信される詳細を示すxmlがあるので、KSOAPリクエストで次のxmlを変換する方法を教えてください。ありがとうございます。

<location>
<locationId>132</locationId>
<name>test</name>
<qualifiedCoordinates>
<altitude>10</altitude>
</qualifiedCoordinates>
</location>
4

1 に答える 1

0
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();
    }
于 2012-06-15T11:25:07.027 に答える