Arrays 使用svcuti.exe生成的WCF服务代理中的数组而不是列表
我有一份Arrays 使用svcuti.exe生成的WCF服务代理中的数组而不是列表,arrays,wcf,generic-list,proxy-classes,Arrays,Wcf,Generic List,Proxy Classes,我有一份服务合同 using System.Collections.Generic; using System.ServiceModel; namespace MainModule.Sub.Communication { [ServiceContract] public interface IWebMethod { [OperationContract(IsOneWay = false)] bool InvokeAlert(List<
服务合同
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);
}
}
甚至我添加了
ct
开关(collectionType),代理将其生成为数组(int[]
)。如果我没有记错,/ct开关(在某些情况下?)可能不会对操作合同级收款产生任何影响,那么如何在不使用VS中的添加服务参考窗口的情况下执行此操作。尝试使用包装器数据契约类型,例如bool InvokeAlert(invokealertr)
其中InvokeAlertRequest
将是一个[DataContract]
类型,其中包含一个[DataMember]列表用户标识代码>如果SvcUtil无法创建使用DataContractSerializer而改用XmlSerializer的代理,则/ct开关将停止工作
这只是一个猜测,但我怀疑可能是System.Data.DataSet
造成的。这里您有同样的问题
SvcUtil.exe http://localhost/MainCommunicationServer/wm /ct:System.Collections.Generic.List`1 /out:HTTPRouterServerProxy.cs