cancel
Showing results for 
Search instead for 
Did you mean: 

How to read complex Web Service structure from WD

former_member182374
Active Contributor
0 Kudos

Hi all,

I've a complex data output from a Web Service that I cannot read from WD.

It's an array of:

String firstName

String lastName

String[] myArray

When I run it from WS navigator it works (see screenshot1)

http://img705.imageshack.us/img705/3945/complex1.jpg

but when I run it from Web Dynpro I cannot access myArray values of each row, I can read only the first entry (see WD structure screenshot2).

http://img28.imageshack.us/img28/3614/complex2.jpg

Since I wrote the WS I can easily change the structure but what kind of structure will allow me to read the array values from WD?

Thanks,

Omri

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182374
Active Contributor
0 Kudos

Solved it on my own by casting the result to plain java list object...

List theList = wdContext.currentResponseComplex2Element().modelObject().getComplexBean();
    for (int i=0; i<wdContext.nodeComplexBean().size(); i++) {   
       
        ComplexBean complexBean = (ComplexBean) theList.get(i);
        wdComponentAPI.getMessageManager().reportSuccess(complexBean.getFirstName());
        wdComponentAPI.getMessageManager().reportSuccess(complexBean.getLastName());
       
        ArrayOfString arrayOfString = complexBean.getMyArray();
        List stringList = arrayOfString.getString();
        for (int j=0; j<stringList.size(); j++) {
            String_Item stringItem = (String_Item) stringList.get(j);
            wdComponentAPI.getMessageManager().reportSuccess(stringItem.getItem());
        }
    }
    wdComponentAPI.getMessageManager().reportSuccess("----------------------------------------------------");

Omri