c# - How to pass Interface as parameter in WCF service? -
i have next not sure right way of doing it.
namespace wcfservices { [servicecontract(name = "iservice")] [serviceknowntypeattribute(typeof(dataitem))] public interface iservice { [operationcontract] void instantiatethirdparties(string name, ienumerable<idataitem> data, ienumerable<string> modules, ienumerable<string> states); } }
this code uses interface.
namespace wcfservices { public class service : iservice { public void instantiatethirdparties(string name, ienumerable<idataitem> data, ienumerable<string> modules, ienumerable<string> states) { process.executeall(name, data, modules, states); } } }
and object type @ moment following.
namespace dataobjects { [serializable] [datacontract] public class dataitem : idataitem { public dataitem(); [datamember] public customerinfo client { get; set; } [datamember] public loaninfo loan { get; set; } [datamember] public datetime loanprocessingdate { get; set; } [datamember] public string moduleid { get; set; } [datamember] public string processingstate { get; set; } } }
am headed in right direction?
you need utilize knowntypeattribute instead of serviceknowntypeattribute.
c# wcf
No comments:
Post a Comment