By using Dynamic Proxy namespace, I am trying to create and consume a WCF service dynamically. I have declared a contract like below:
[OperationContract]
long GetStrings(string sinput, int n, out List<String> lstStrings);
on Client side, I am collecting information as below:
MethodInfo getStrings = proxyType.GetMethod("GetStrings");
Type strType = getStrings.GetParameters()[0].ParameterType;
Type strType1 = getStrings.GetParameters()[1].ParameterType;
Type strType2 = getStrings.GetParameters()[2].ParameterType;
The name of the types are coming as follows:
strType = "String[]&"
strType1 = "String"
strType2 = "int"
My questions are:
- Why the order of parameters is getting changed i.e. parameters defined as 'out' are coming before others?
- How can correct the order of parameters for the method?
- How can I make our parameter to List instead of String[]?
Thanks in advance.