Passing an array to a WCF service

Is it possible to pass an array as an argument from C # code to a WCF web service?

I'm still new to this.

Please, help.

thanks

+4
source share
1 answer

Yes, absolutely. Your service contract might look like this:

[ServiceContract] public interface IFooService { void Foo(int[] intArray); } 

If you want to pass an array of some custom type, this type must be marked with [DataContract] and its properties using [DataMember] .

+5
source

Source: https://habr.com/ru/post/1310615/


All Articles