本文整理汇总了C#中Server.CreateManagementService方法的典型用法代码示例。如果您正苦于以下问题:C# Server.CreateManagementService方法的具体用法?C# Server.CreateManagementService怎么用?C# Server.CreateManagementService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server.CreateManagementService方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterManagementService
private void RegisterManagementService(Server cepServer, string hostUrl)
{
/////////////////////////////////////////////////////////
// Register the management service
var service = cepServer.CreateManagementService();
_cepManagementHost = new ServiceHost(service);
_cepManagementHost.AddServiceEndpoint(
typeof(IManagementService),
new WSHttpBinding(SecurityMode.Message),
hostUrl);
_cepManagementHost.Open();
}
示例2: CreateWebService
/// <summary>
/// Create a web service for the server.
/// </summary>
/// <param name="server">The server to create a web service for.</param>
/// <returns>The new ServiceHost.</returns>
private static ServiceHost CreateWebService(Server server)
{
var host = new ServiceHost(server.CreateManagementService());
// create a binding for the service
WSHttpBinding binding = new WSHttpBinding(SecurityMode.Message);
host.AddServiceEndpoint(
typeof(IManagementService),
binding,
"http://localhost:8090/");
host.Open();
return host;
}