I'm trying to follow this post.
To reproduce a sample xml request I have in hand. The problem is that this particular request is pretty long with very deep structure, and I just get tired of adding child elements and keeping track of the structure with my eyes.
Below is some sample code that summarised what I have been doing. The request I am reproducing has at least 5 layers and more than 50 elements. It's supposed to be an application form which contains candidates personal information.
// SOAP Envelop...
// SOAP Body
SOAPBody soapBody = envelope.getBody();
SOAPElement aaa = soapBody.addChildElement("aaaName", "", "http://my.uri.aaa");
SOAPElement bbb = aaa.addChildElement("bbbName", "", "http://my.uri.bbb");
SOAPElement ccc = bbb.addChildElement("cccName");
SOAPElement ddd = ccc.addChildElement("dddName");
//... and so on ...
SOAPElement dddChild1 = ddd.addChildElement("dddChild1Name");
dddChild1.addTextNode("I'm dddChild1");
SOAPElement dddChild2 = ddd.addChildElement("dddChild2Name");
SOAPElement dddGrandChild2 = dddChild2.addChildElement("dddGrandChild2Name");
dddGrandChild2.addTextNode("I'm dddGrandChild2");
//... and so on ...
Could anyone give some advice on how to make it a bit easier to construct/read/manage?