cancel
Showing results for 
Search instead for 
Did you mean: 

ArrayList in Visual Composer

Former Member
0 Kudos

Hi everybody,

…I exposed a Composite Application Service (which works fine) as a Web Service. For your information: The Response of the Composite Application contains simple data types like “String” and a collection “list” (ArrayList) of Strings.

I defined the new WebService in the Visual Composer. But as I tested the service, I got no response (only the simple data types; no ArrayList).

So I decided to write a simple WebService which contains an Array (instead of an ArrayList) as output. And this works fine in the Visual Composer.

My question to you: Is it not possible to work with an ArrayList (response from the application Service) in VC and/or how can I configure the response in the Application service? Is it my fault or a bug?

Regards,

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

ankur_garg5
Active Contributor
0 Kudos

Hi Stefan,

Came to know something new yesterday, thought why not share it with you.

There is some type of size limit of what can be used in a VC application, which is something like 32 kb. An ArrayList is dynamic in nature, so during designtime VC does not know what is its size going to be at runtime, that is why ArrayList as a return type of a web service operation is not supported in VC.

Bye

Ankur

Reward points if it helps!!

Answers (2)

Answers (2)

ankur_garg5
Active Contributor
0 Kudos

Hi Stefan,

I have tried similar things while creating web services and using them in VC. Its not your fault, <b>Arraylist</b> as well as <b>Arrays with more than single dimension</b> are not supported in VC as response parameters of a web service.

But you can try one thing, if it helps..

Inside the web service operation, where you are working with Arraylist, in the end convert this Arraylist to an Array. An example in this regard is a statement like:

String emp_array[] = new String[emp_arraylist.size()];

emp_array = (String[])emp_arraylist.toArray(new String[] {});

Remember to give the return type of your function as an Array.

Reward points if this helps.

Former Member
0 Kudos

Please see in the Visual Composer WIKI

https://wiki.sdn.sap.com/wiki/display/VC/Connectivity

under Web services the entries corresponding to arrays and fields.