【发布时间】:2021-02-22 09:10:12
【问题描述】:
我开发了一个 wcf 服务来为我进行数据库操作。并且在https://blahblah.com/myService.svc这样的地址上工作
当我把这个网址写到浏览器时,没问题,它可以工作,没问题。
我开发了一个使用这个 wcf 服务的 asp.net 项目。在我的 asp.net web.config 中有一个这样的 endponint 属性:
<endpoint address="https://blahblah.com/myService.svc" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IMyService" contract="MyService.IMyService" />
在 localhost(没有 https)中,它与这个端点地址一起工作。但是在服务器的 IIS 中它不起作用并抛出错误“没有端点...”
当我把地址改成这个时:
<endpoint address="https://blahblah.com/myService.svc/myService.svc" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IMyService" contract="MyService.IMyService" />
它正在使用此配置。我不明白为什么它在服务器的 IIS 中使用此配置。谁能解释一下这种情况的逻辑?
【问题讨论】:
-
您需要提供您的配置文件以及您在 iis 上发布的方式。
标签: asp.net wcf wcf-binding