0

I want to debug a WCF service locally in Visual Studio. The called function looks like this:

public void PerformAction(Directory[] dirs) {
    ....
}

Directory is a class with some properties. In the WCF test client I want to test the function but how can I set the input values for the Directory array?

ZerOne
  • 1,296
  • 6
  • 20
  • 40
  • Can you put the URL/endpoint that the host application is listening on into a browser or some other client and make a error free connection? – Ross Bush May 10 '19 at 14:43

1 Answers1

1

Taking the default WCF template as an example, I made the following definition.

[OperationContract]
        //[WebGet(RequestFormat =WebMessageFormat.Json,ResponseFormat =WebMessageFormat.Json)]
        string GetData(CompositeType[] value);

        public string GetData(CompositeType[] value)
        {
            return string.Format("You entered: {0},{1}", value[0].StringValue,value[1].StringValue);
        }

First enter the length of the array, then select the array type, and finally enter the values of the individual elements one by one.
enter image description here
Wish it is useful to you, feel free to let me know if there is anything I can help with.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22