Using arraylist from .net dll

Using arraylist from .net dll


I am trying to integrate a function from a c# .NET DLL . The function will return an arraylist of computernames. When I import the function using Integration Studio the selected data type is object.

I am not able to use an object in Service Studio to retreive the names and I would like to get a list of strings instead.

When I use a C# function returning a String Everythings works ok

How should I do this?

The C# code I use for the .NET DLL

using System;
using System.Collections.Generic;
using System.Text;
using ServerEnumerator;

namespace NetworkTools {
public class NetworkClass
static public System.Collections.ArrayList GetDevicesList()
System.Collections.ArrayList alist = new System.Collections.ArrayList();


return alist;

static public string GetDevicesString()
string list = "Computer1";

return list;

I also attached the xif file

You need to create a structure and define a recordlist as output of the function. There are an oml as attachment with an example of that, i change the devices list action to insert the devices to a outsystems record list.

Nelson Inácio
Thank you, for the response I tried it but it did not work yet. It might also be my DLL.

I will try it again at a later moment.


Peter Braat
I could not resist finding out why returning a filled record list did not work in my extension. So after a while trying to figure out why. I finally noticed that the record list parameter in my action was defined as an input instead of an output parameter.
After fixing that I was able to retrieve a list from the extension back into my screen action code within service studio.

The final code in the extension looks now something like this:

public void MssNetworkClassGetDevicesList(out OutSystems.NssNetworkTools.RLComputersListRecordList ssComputersList) {

// Init the return recordlist with ane emtpy record list
ssComputersList = new RLComputersListRecordList();

// Row object
RCComputersListRecord Row;

// Some c# code in a dll returning a list of devices connected to the network
System.Collections.ArrayList ssReturn_ArrayList = NetworkTools.NetworkClass.GetDevicesList();

// Add all discoverd items from the array list in the outsystems record list
foreach (string computername in ssReturn_ArrayList)
// Create a new row-object to be added to the record list
Row = new RCComputersListRecord();

// Put the name from the current device into the row-object
Row.ssSTComputersList.ssComputerName = computername;

// Add the row to the record list.



I have included my sample extension just incase somebody who like to have a look at it. The main purpose of it is to return a list of devices connected to your network. It is not perfect, but it was a good learning exercise.

Hopefully someone else can reuse this when trying to do something similar with an extension.


Peter Braat