积极答复者
HTTP Error 404.0 - Not Found

问题
-
i am learning wcf recently.
when i host a service to the console application. code as below:
using (ServiceHost host = new ServiceHost(typeof(TrackingLogService)))
{
host.AddServiceEndpoint(typeof(ITrackingLogService),
new BasicHttpBinding(),
"http://127.0.0.1/TrackingLogService");
host.AddServiceEndpoint(typeof(ITrackingLogService),
new NetTcpBinding(),
"net.tcp://127.0.0.1:8888/TrackingLogService");
host.Open();
}
Console.ReadLine();i start the host application and it run ok without any exception.
but when i got to browser and type:http://localhost/TrackingLogService
i got the following error:
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
if i change the 80 port to 8001 and got to browser to view : http://localhost:8001/TrackingLogService,the page can't load.
can anyone help on this.
答案
-
Hi,
You don't expose the servicemetadata for the WCF service. And for more information about Publish Metadata for a WCF Service:
http://www.cnblogs.com/malaikuangren/archive/2012/06/24/2560175.html
- 已建议为答案 Ken Lin, MSMVP for .NET (2003-2017), rMVP 2014年11月10日 10:24
- 已标记为答案 Shawn ZhaoModerator 2014年11月13日 8:56
-
Hi, you could read the following link for more pratice code from MSDN,
http://msdn.microsoft.com/en-us/library/ms731758(v=vs.110).aspx
大家一齊探討、學習和研究,謝謝!
MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
MCT, Microsoft Community Star(TW & HK),
Microsoft MVP for VB.NET since 2003
My MSMVP Blog- 已建议为答案 Ken Lin, MSMVP for .NET (2003-2017), rMVP 2014年11月10日 10:24
- 已标记为答案 Shawn ZhaoModerator 2014年11月13日 8:56
全部回复
-
Hi,
You don't expose the servicemetadata for the WCF service. And for more information about Publish Metadata for a WCF Service:
http://www.cnblogs.com/malaikuangren/archive/2012/06/24/2560175.html
- 已建议为答案 Ken Lin, MSMVP for .NET (2003-2017), rMVP 2014年11月10日 10:24
- 已标记为答案 Shawn ZhaoModerator 2014年11月13日 8:56
-
Hi, you could read the following link for more pratice code from MSDN,
http://msdn.microsoft.com/en-us/library/ms731758(v=vs.110).aspx
大家一齊探討、學習和研究,謝謝!
MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
MCT, Microsoft Community Star(TW & HK),
Microsoft MVP for VB.NET since 2003
My MSMVP Blog- 已建议为答案 Ken Lin, MSMVP for .NET (2003-2017), rMVP 2014年11月10日 10:24
- 已标记为答案 Shawn ZhaoModerator 2014年11月13日 8:56