【发布时间】:2012-12-31 11:53:27
【问题描述】:
我有一个ServiceContract,
using System.Collections.Generic;
using System.ServiceModel;
namespace MainModule.Sub.Communication
{
[ServiceContract]
public interface IWebMethod
{
[OperationContract(IsOneWay = false)]
bool InvokeAlert(List<int> userIds);
[OperationContract(IsOneWay = false, Name = "InvokeAlertByMainID")]
bool InvokeAlert(List<int> userIds, int mainId);
[OperationContract(IsOneWay = true)]
void DeletePopupNotifications(System.Data.DataSet deletedNotifications);
}
}
我使用以下命令生成代理(我必须使用 command-line 而不是通过 Add Service Reference 来执行此操作。
SvcUtil.exe http://localhost/MainCommunicationServer/wm /ct:System.Collections.Generic.List`1 /out:HTTPRouterServerProxy.cs
即使我添加了ct 开关(collectionType),代理也将其生成为数组(int[])。如果不使用 VS 中的Add Service Reference 窗口,我怎么能做到这一点
【问题讨论】:
标签: arrays wcf generic-list proxy-classes