简体   繁体   English

在IIS中托管WCF服务

[英]Hosting WCF service in IIS

I am trying to host the service in IIS but I get Page Not found error. 我试图在IIS中托管服务,但出现“找不到页面”错误。 Here is what I did to host in IIS 这是我在IIS中托管的内容

  1. Created a WCF Service application (BillingService) 创建一个WCF服务应用程序(BillingService)
  2. I have two classes called IBillSrv.cs (as Base) and BillSrvc.cs 我有两个名为IBillSrv.cs(作为基础)和BillSrvc.cs的类
  3. Added a new WCFService website (BillSrvcSite) to the solution and added a reference to the above mentioned (BillingService). 在解决方案中添加了一个新的WCFService网站(BillSrvcSite),并添加了对上述内容(BillingService)的引用。
  4. In IIS created a new Virtual site and mapped it to BillSrvSite 在IIS中创建一个新的虚拟站点并将其映射到BillSrvSite
  5. Opened the Web.Config and changed the endpoint contract to IBillSrv 打开Web.Config并将端点协定更改为IBillSrv

When I run it works fine in the WCF test client. 当我运行时,它在WCF测试客户端中运行良好。 but when i paste the below url in IE I get page not found. 但是当我在IE中粘贴以下网址时,找不到页面。 http://localhost/BillingService/BillSrvc/ http:// localhost / BillingService / BillSrvc /

I am using C# 2008 Can someone please advise what is missing or where I am going wrong? 我正在使用C#2008,有人可以告诉我丢失了什么或我哪里出错了?

This has nothing to do with persistence. 这与持久性无关。 An interface member like ParseTestQues can only be implicitly implemented by a public method. 诸如ParseTestQues类的接口成员只能由公共方法隐式实现。 Simply make ParseTestQues be public. 只需将ParseTestQues公开即可。


Isn't your service endpoint named something like "BillSrvc.svc"? 您的服务端点是否命名为“ BillSrvc.svc”? Try typing http://localhost/BillingService/BillSrvc/BillSrvc.svc into the browser and see what happens. 尝试在浏览器中输入http://localhost/BillingService/BillSrvc/BillSrvc.svc ,然后看看会发生什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM