0

I have created a WCF service and exposed a function which accept List as a parameter.

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)

when I call this function it ask me to provide string[] instead of List

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

it gives me this error of invalid arguments.When I call it with string it accept it.

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

What do I do If I want to accept only List?

monofal
  • 1,928
  • 1
  • 13
  • 15

1 Answers1

2

It is relevant to how you added the service reference. You can choose the collection type while add the service reference.

Add Service Reference -> Input your Url and with Advanced button you can select System.Collection.Generic.List for collection option.

lucky
  • 12,734
  • 4
  • 24
  • 46