Passing string array to webservice method
问题 I have a web service with this method: [WebMethod] public int[] stringTest(string[] tString) { int numberOfStrings = tString.Length; int[] returnS = new int[numberOfStrings]; for (int i = 0; i <= numberOfStrings; i++) { returnS[i] = 1; } return returnS; } And then I'm trying to pass an array of strings to it from a client program as following: var client = new WebServiceSample.WebService1SoapClient(); string[] parameterNames = { "Windsensor","Temperature sensor"}; test = client.stringTest