When i try to return data from CUCM AXL api, using the code below
ExecuteSQLQueryReq query = new ExecuteSQLQueryReq();
query.sql = "select * from systables ";
string[] model = null;
//get tables
try
{
executeSQLQueryResponse response = await client.executeSQLQueryAsync(query);
model = response.executeSQLQueryResponse1.@return.Cast<string>().ToArray();
}
catch (Exception ex)
{
Console.WriteLine($"\nError: getQuery: { ex.Message }");
Environment.Exit(-1);
}
Console.WriteLine($"\ngetQuery: SUCCESS model: { model }\n ");
i get sytem.object[] instead of the sql data, i have tried looping from each data using the code below
foreach ( string no in model)
{
Console.WriteLine(no.ToString());
}
error i get is :
Unable to cast object of type 'System.Xml.XmlNode[]' to type 'System.String'.
is there a way to get the data returned without the back and forth conversion
I have been following the example here
any help would be appreciated