Android ksoap2 addProperty

孤街醉人 提交于 2020-01-24 01:54:06

问题


The complete code

try {

            SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

            request.addProperty("arg0", "admin");
            request.addProperty("arg1", "3");
            request.addProperty("arg2", "ABC");
            request.addProperty("generalItemId", "342");
            request.addProperty("sets", "1");

            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
            envelope.setOutputSoapObject(request);  

            HttpTransportSE httpTransport = new HttpTransportSE(URL);

            httpTransport.debug = true;  

            httpTransport.call(SOAP_ACTION, envelope);

            try {
                result = (SoapObject)envelope.getResponse();
            } catch (SoapFault e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } 
            Log.d("App",""+result.getProperty(1).toString());
            response = result.getProperty(1).toString();

The request

  <soapenv:Header/>
   <soapenv:Body>
      <ser:requestForSwatch>
         <!-- Login Name -->
         <arg0>admin</arg0>
         <arg1>3</arg1>
         <!-- Remarks -->
         <arg2>ABC</arg2>
         <!--Optional:-->
         <arg3>
           <item>
               <!--Optional:-->
               <generalItemId>342</generalItemId>
               <!--Optional:-->
               <sets>1</sets>
            </item>
         </arg3>
      </ser:requestForSwatch>
   </soapenv:Body>
</soapenv:Envelope>

I already know the first property is "arg0", and the second is "arg1" .

But i want to know what is the property of "generalItemId" and "sets". Because i input

request.addProperty("generalItemId", "342");

It is not work, does anyone know the solution?

来源:https://stackoverflow.com/questions/31917522/android-ksoap2-addproperty

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!