Dynamically create objects, set value and call
In my application I am processing XML using xstream and getting mGnrt object then setting it to wrapper after adding headerObjects and sending to DataService for execution.
Below is a sample code, for doing same...In my application for each service request I have to do the below thing but Objects will change means the "Some" part in below code is variable and will be replaced by service name ..
how to achieve this means to deal it dynamically....
XStream xstream = new XStream();
SomeRequestGnrt mGnrt=(SomeRequestGnrt)xstream.fromXML("<SomeReque stGnrt> <UserId>nits</UserId> <Pswd>1234</Pswd></SomeRequestGnrt>");
SomeRequestWrapper someRequestWrapper = new SomeRequestWrapper();
RequestObjectHeader requestObjectHeader = someRequestWrapper.getRequestHeader();