on 12-27-2007 11:08 AM
Hi All,
I am stuck at a point where I have a Java Webservice resulting an ArrayList Response.
My webdynpro will have to populate the ArrayList response into a table.
Below is the piece of code am using to execute my webservice.
CODE :
JavajdbcModel md = new JavajdbcModel();
Request_Display reqDisp= new Request_Display(md);
try
{
reqDisp.execute();
wdComponentAPI.getMessageManager().reportSuccess("Str: "+reqDisp.getResponse());
}
RESULT :
<modelObject class="Response_Display"><target roleName="DisplayResponse"><modelObject class="DisplayResponse"><attribute name="Response" value="[[i01111, USSS, DSGTechTwo, DEF], [i012345, USSS, DSGTechOne, ABC], [i067890, USSS, DSGTechTwo, DEF], [i07777, USSS, DSG, ggg], [i08888, cccc, vvvv, bbbb], [io3333, USSS, DSGTechOne, abc]]"/></modelObject></target></modelObject>
The required output are the values that are with the blue font above.
I have tried with methods like :
getAttributeValue, getResult - but are of not much help.
Could you please help me out in this.
Thanks & Regards,
Suyukti. B N.
Dear Suyukti,
Since your web service returns an arraylist,
you need to retreive the response into an arraylist. Then you can you this arraylist to populate the node for the table as required.
Your code will be something like
ArrayList al = (ArrayList)reqDisp.getResponse();
Now that you have the response, then use the get function of the arraylist to set the context.
al.get(index);
This function returns java.lang.Object, so you need to to cast into the required type.
e.g. String str = (String) al.get(0);
Hope that works.
Regards,
Mayuresh.
PS: xxxxxxxxxxxxxxxxxxxxxxxxxx
Edited by: Armin Reichert on Jan 1, 2008 3:49 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.