Dynamically create objects, set value and call
Hi,
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....
Quote:
XStream xstream = new XStream();
xstream.alias("SomeRequestGnrt",SomeRequestGnrt.class);
SomeRequestGnrt mGnrt=(SomeRequestGnrt)xstream.fromXML("<SomeReque stGnrt> <UserId>nits</UserId> <Pswd>1234</Pswd></SomeRequestGnrt>");
SomeRequestWrapper someRequestWrapper = new SomeRequestWrapper();
someRequestWrapper.setSomeRequestGnrt(mGnrt);
RequestObjectHeader requestObjectHeader = someRequestWrapper.getRequestHeader();
DataService.LognAuth(SomeRequestWrapper,ctxt);