I have a WCF service with many functions. Some of them contain List<string>
arguments. e.g
[ServiceContract]
public interface IQueriesService
{
[OperationContract]
DataTable ExecuteSimpleQuery(List<string> sel, List<string> fr, List<string> whereCells, List<string> types, List<string> whereOps, List<string> whereValues, List<string> logOp, int cultureLCID);
}
public class UniverService : IQueriesService
{
public DataTable ExecuteSimpleQuery(List<string> sel, List<string> fr, List<string> whereCells, List<string> types, List<string> whereOps, List<string> whereValues, List<string> logOp, int cultureLCID)
{
DataTable dt = new DataTable();
...
return dt;
}
}
simpleQ.Select = simpleQ.Select.Distinct().ToList();
simpleQ.From = simpleQ.From.Distinct().ToList();
DataTable dt = svc.ExecuteSimpleQuery(simpleQ.Select, simpleQ.From, simpleQ.WhereCell, simpleQ.Type, simpleQ.WhereOp, simpleQ.WhereValue, simpleQ.LogicOperation, Thread.CurrentThread.CurrentUICulture.LCID);
where simpleQ.Select, From, ... are of type List<string>
When I add my service reference to other project, in Service Reference Settings window I change Collection Type from System.Array
to System.Collections.Generic.List
.
My problem is that the mentioned conversion works for some of my functions and doesn't for others. I mean after adding service reference and rebuilding it I get an error
Cannot convert from List to string[] . When I look into generated proxy classes, I see that those functions really have string arrays (and not lists) as their arguments.
Who can help me?