English 中文(简体)
Self-Hosting WCF with Self-Hosting WebServer (HTTPListener) on the same Port. 可能吗?
原标题:Self-Hosting WCF with Self-Hosting WebServer (HTTPListener) on the same port. Possible?

我在做一个评估,我需要提供网络接口。 我正在考虑利用世界合作框架为网络接口提供服务,并自发地提供我的照片(无IIS)。 现在,如果这两个港口不使用同一港口,浏览器将抱怨XSS......

这是可能的吗? 这是一种好的想法吗?

EDIT After some investigation, I ve managed to make it work.

这里是网络服务自赠守则:

var serviceHost = new ServiceHost(typeof(CalculatorService));
serviceHost.AddServiceEndpoint(typeof (ICalculator), new WSHttpBinding(), "http://localhost:8000/webservice");
serviceHost.Open();

Console.WriteLine("CalcService is running.");
Console.WriteLine("Press Enter to terminate the service.");
Console.ReadLine();
serviceHost.Close();

这里还有网站主编:

var listener = new HttpListener();
listener.Prefixes.Add("http://localhost:8000/webconsole/");
listener.Start();
Console.WriteLine("listening");
while(true)
{
    HttpListenerContext context = listener.GetContext();
    /* ... */
}

关于网络服务,我需要做以下工作:

最佳回答

Yep-工程罚款。 HTTP。 SYS将吉大港山区开发计划推向世界渔业委员会所利用的不足,只要它们采用不同的路线,就可任意地分享同一个港口。 我正是出于同样的原因这样做的。

这赢得了IS 5.1或VS网络服务器的XP工作,但就在你尝试的情况下。 他们不是吉卜赛人。 SYS的基地是这样,他们预计会只靠港口。 否则,(包括拥有2个周转基金东道方的XP),你会回馈。

问题回答

很抱歉,我不得不看到这一点。 如果做不到其他工作,那么你可以把它作为两个单独的港口加以保留,但随后可能利用一种反向的代理来排除世界合作框架的终点?





相关问题
WCF DataMember Serializing questions

Ok, so I was part way through the long winded process of creating DTOs for sending my model over the wire and I don t feel like I m going down the right route. My issue is that most of the entities ...

Access WCF service on same server

I have a .NET website with a WCF service. How do I access the current operations context of my service? One possible work around is to just make a call to the service within the app...but that seems ...

WCF binding error

So I got into work early today and got the latest from source control. When I try to launch our ASP.NET application, I get this exception: "The binding at system.serviceModel/bindings/wsHttpBinding ...

The service operation requires a transaction to be flowed

I am facing strange issue with our WCF service. The same code was working fine until recently we added more OperationContracts(Web Methods). We have common 3 tier architecture. DAL (WCF) BLL Web ...

热门标签