Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 使用svcuti.exe生成的WCF服务代理中的数组而不是列表_Arrays_Wcf_Generic List_Proxy Classes - Fatal编程技术网

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