Skip to Content
0
Former Member
May 07, 2004 at 12:23 PM

Web Service Model with ArrayList return value

39 Views

Hi,

I wrote a session bean method that returns an java.util.ArrayList.

Then I generated a web service for this session bean and imported this web service into a Web Dynpro model.

I can then execute this web service model and get the ArrayList in the method result (means in the result of the model instance) but I cannot bind this model to e.g. a table control with the following error message:

"ContextAttribute has JavaNativeType ArrayList. ContextAttribute with java native type cannot be selected."

This is o.k. so far but is there a way (workaround) to use any collection class as result of my web service method?

Background: Normally I´m and many users work with the java collection framework. At the moment I have to convert the Collection into an array with the following construct and return the array.

MyType[] tmp = new MyType[1];

return (MyType[])list.toArray(tmp);

When I then create a model in Web Dynpro the members of MyType are generated as model attributes.

This works but is not the way I would like to work. I would prefer to work with my Collection class.

Thanks for an answer

Helmut