How to add an attribute to the XML tag using Ksoap in android? XML tag to be constructed are given below
<IndividualDetails>
<GoodsTagMaterialQuantity unitCode="EA">20</GoodsTagMaterialQuantity>
</IndividualDetails>
find the android code given below using ksoap library
// Individual Details
SoapObject individualDetails = new SoapObject();
individualDetails.addProperty("ExternalSerialID", "WAREHOUSE TASK " + taskId);
individualDetails.addProperty("GoodsTagMaterialQuantity", actualQuantity).addAttribute("unitCode","EA");
output:
<IndividualDetails unitCode="EA">
GoodsTagMaterialQuantity>20</GoodsTagMaterialQuantity>
</IndividualDetails>
Example Code:
Example Output: