How to read data from array object of CLR data type

Hi,

I am consuming web service an using that service method i am sending some information. That web service method return type is array object, how can i read return data in Ax 2012. The below code is the web service method which is written in visual studio using C#.

public LeaveData[] ApplyLeave(string empcode, string fromdate, string todate, string compname, string cancelled)
{
object[] results = this.Invoke(“ApplyLeave”, new object[] {empcode,fromdate,todate,compname,cancelled});
return ((LeaveData[])(results[0]));
}

From ax i am calling this method like below,

ApprovedLeaveData.ApplyLeave(EmployeeId,startDate,endDate,companyName,“N”);

How to read the return data of the above method?

Thanks &Regards

Anilkumar

Details depends on the exact type returned by proxyApplyLeave() method of your proxy class. (It doesn’t have to be precisely the same type used in the service implementation).

For arrays, you can use the for loop, nevertheless the most generic approach is using an enumerator. See the following example with an array of strings:

System.String[] drives = System.Environment::GetLogicalDrives();
System.Collections.IEnumerator enumerator = drives.GetEnumerator();
str drive;
    
while (enumerator.MoveNext())
{
    drive = enumerator.get_Current();
    info(drive);
}