我不是C#或.NET专家.但是,我必须使用它......
我正在运行InstallUtil.exe MyService.exe以安装基本上运行WCF服务的Windows服务.我已经定义了WFC接口并实现了它.以下是界面.
[ServiceContract(Namespace = "http://WCFService", Name = "WCFService")]
public interface IWCFService
{
[OperationContract]
User Login(string userName, string password);
[OperationContract]
List<Project> GetProjects(Guid userGuid);
[OperationContract]
List<Stylesheet> GetStylesheets(Guid projectGuid);
}
Run Code Online (Sandbox Code Playgroud)
我还定义了一个Windows服务,如下所示:
public partial class Service: ServiceBase
{
public FlatWsdlServiceHost m_fwsh = null; // extends ServiceHost
public DesignerService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
this.EventLog.WriteEntry("OnStart Successfull", EventLogEntryType.Information);
if (m_fwsh != null)
{
m_fwsh.Close();
}
// Create a ServiceHost for the EventWebService type and
// provide the base address. …Run Code Online (Sandbox Code Playgroud)