传递阵列WCF服务 [英] Passing array to WCF service
本文介绍了传递阵列WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能通过数组作为从C#code到一个WCF Web服务的参数?
Is it possible to pass an array as an argument from a C# code to a WCF web service?
我还是新的这一切。
请帮忙。
感谢
推荐答案
是绝对的。您的服务合同可能看起来像这样:
Yes absolutely. Your service contract could look like this:
[ServiceContract]
public interface IFooService
{
void Foo(int[] intArray);
}
如果你想通过一些自定义类型的数组这个类型需要被打上 [DataContract]
及其与性能[数据成员]
。
If you want to pass an array of some custom type this type needs to be marked with [DataContract]
and its properties with [DataMember]
.
这篇关于传递阵列WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文