【问题标题】:Understanding Wcf Service Endpoint Logic了解 Wcf 服务端点逻辑
【发布时间】: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


【解决方案1】:

以下情况可能会发生:

  1. 您的服务名称和文件夹名称在 IIS (myService.svc) 中相同。即在名为“myService.svc”的文件夹中,您可能会出现名为“myService.svc”的服务

  1. 您可能在 IIS 中将别名设置为“myService.svc”。 (要验证,请单击您的站点 --> 基本设置 --> 别名

【讨论】:

  • 感谢您的回复。没有文件夹“myService.svc”。文件夹“myService”和 IIS 网站探索这个文件夹,这个文件夹包含“myService.svc”我在基本设置中看不到“别名”。但我的服务托管在域中,它是 https。
猜你喜欢
  • 1970-01-01
  • 2012-01-13
  • 2016-02-22
  • 2010-12-03
  • 1970-01-01
  • 2020-09-12
  • 2012-07-22
  • 2018-08-02
  • 1970-01-01
相关资源
最近更新 更多