我甚至不确定这是否就是我想做的事情,但我需要向服务器发送一些看起来像这样的内容
<ECMMAID>int</ECMMAID>
<appIncData>
<int_inc_num>int</int_inc_num>
<respTime>dateTime</respTime>
<arriveTime>dateTime</arriveTime>
<sceneControlledTime>dateTime</sceneControlledTime>
<retStationTime>dateTime</retStationTime>
<sceneClearedTime>dateTime</sceneClearedTime>
<assist>boolean</assist>
<unitNotes>string</unitNotes>
<incidentPath>string</incidentPath>
<totalCalculatedFromThePathMiles>double</totalCalculatedFromThePathMiles>
<startOdmeterMilage>double</startOdmeterMilage>
<endOdmeterMilage>double</endOdmeterMilage>
<startEngineHours>double</startEngineHours>
<startPumpHoursReading>double</startPumpHoursReading>
<engineHours>double</engineHours>
<currentPumpHoursReading>double</currentPumpHoursReading>
</appIncData>
现在,我使用ksoap
完成的所有其他网络服务一直只是一堆带有值的属性,但在标签
基本上就像这样
request.addProperty("ECMMAID","");
request.addProperty("Name",);
request.addProperty("Content",);
request.addProperty("STID",);
request.addProperty("IncNum",);
request.addProperty("Notes","");
request.addProperty("uploader",);
如何在ksoap中发送我需要的内容,或者我应该使用HttpPost?
答案 0 :(得分:0)
尝试类似于以下代码的内容。我在我的应用程序中使用了类似的代码将xml格式数据发送到服务器。
PropertyInfo req = new PropertyInfo();
req.name="appIncData";// may be different in your case
req.type=String.class;
req.setValue("<ECMMAID>"+int+"</ECMMAID>"+
"<appIncData>"+
"<int_inc_num>"+int+"</int_inc_num>"+
" <respTime>"+dateTime+"</respTime>"+
"</appIncData>");
request.addProperty(req);