0
WCF 서비스 프로젝트를 만들었습니다. SVC 파일에 다음 내용이 있습니다.Windows 서비스로 WCF 서비스 호스팅
<%@ ServiceHost Service="Deepak.BusinessServices.Implementation.ApiImplementation"
Factory="Deepak.BusinessServices.Implementation.CustomServiceHostFactory"%>
SVC 참조
http://localhost/DeepakGateway/Service.svc
서비스 UP 및 WSDL을 생성한다. 이제이 서비스를 Windows 서비스로 호스팅하려고합니다. 어떻게해야합니까?
"Windows 서비스"를 만들었습니다. 프로젝트에는 다음 코드가 있습니다.
protected override void OnStart(string[] args)
{
if (m_Host != null)
{
m_Host.Close();
}
Uri httpUrl = new Uri("http://localhost/DeepakGateway/Service.svc");
m_Host = new ServiceHost
(typeof(?????? WHAT TO FILL HERE?), httpUrl);
//Add a service endpoint
m_Host.AddServiceEndpoint
(typeof(?????? WHAT TO FILL HERE?),), new WSHttpBinding(), "");
//Enable metadata exchange
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
m_Host.Description.Behaviors.Add(smb);
//Start the Service
m_Host.Open();
}
선택할 수있는 서비스 계약이 많이 있습니다! –
@IsharehappyK :이 엔드 포인트에서 폭로하고 싶은 것 .... –