Here I need to create a XML for soap request. It may have multiple userid tags like below.
<userid>123</userid>
<userid>456</userid>
...
Below is my code to add that tags into XML.
SOAPElement userid1 = example.addChildElement("userid");
SOAPElement userid2 = example.addChildElement("userid");
userid1.addTextNode("123");
userid2.addTextNode("456");
The above code works for two userids
but not more then that so below is the java code to add tags and values to XML.
for(int i = 0; i < userids.length; i++){
SOAPElement userid+i = example.addChildElement("userid");
userid+i.addTextNode(userids[i]);
}
Here the issue is SOAPElement userid+i = example.addChildElement("userid");
is not working.