2017-11-29 21 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

関連する問題