2017-11-29 2 views
0

WCF 서비스를 만들고 List를 매개 변수로 사용하는 함수를 노출했습니다.목록 <string> 및 문자열 [] WCF?

public bool Execute(string databaseServer, string database, string ClientName, string ERAPayerID, string PlanPriority, List<string> AdjCode, List<string> RemarkCode, List<string> CPT, string Modifier, string renderingProviderNPI) 

나는이 함수를 호출 할 때 문자열 [] 대신 목록은 나에게 그것을 받아 내가 문자열로 호출 무효 arguments.When의 오류를 제공

WriteOffServiceClient client = new WriteOffServiceClient(); 
bool resutl = client.Execute("server", "database", practiseIdentifier, "", ERAPayerId, pPriority, new List<string>, new List<string>, new List<string>, "", ""); 

을 제공하기 위해 나 한테 물어.

WriteOffServiceClient client = new WriteOffServiceClient(); 
bool resutl = client.Execute("server", "database", practiseIdentifier, "", ERAPayerId, pPriority, new string[5], new string[5], new string[5], "", ""); 

내가 할 일 목록 만 허용하려면?

+1

왜 어쨌든 목록을 수락 하시겠습니까? 인수의 'foreach'를 수행해야하는 경우의 90 % 이상이되므로 'IEnumerable '만 있으면됩니다. –

+0

.isGenericType == true 또는 false를 기반으로 결정하는 서비스 측면에서 일부 논리가 있으므로. – Nofi

+0

'List '은'IEnumerable '... –

답변

1

서비스 참조를 추가 한 방법과 관련이 있습니다. 서비스 참조를 추가하는 동안 컬렉션 유형을 선택할 수 있습니다.

서비스 참조 추가 -> URL을 입력하고 고급 버튼을 사용하면 수집 옵션으로 System.Collection.Generic.List을 선택할 수 있습니다.

+0

완벽하지 않습니다! 부탁처럼 일했다. – Nofi