【发布时间】:2013-03-01 09:54:04
【问题描述】:
代码
Web.config
<endpoint address="https://localhost/webapi/ProductData.svc/Secured"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProductData"
contract="Client.IProductData" name="BasicHttpBinding_IProductDataSecured" />
<endpoint address="https://fow01003.fbce.local/webapi/ProductData.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProductData1"
contract="Client.IProductData" name="BasicHttpBinding_IProductData" />
控制器
client = new ProductDataClient("BasicHttpBinding_IProductData"); //This Works
client.Test(); // This fails
错误消息
异常:在https://fow01003.fbce.local/webapi/ProductData.svc 处没有可以接受消息的端点侦听。这通常是由不正确的地址或 SOAP 操作引起的。有关详细信息,请参阅 InnerException(如果存在)。
InnerException:“远程服务器返回错误:(404) Not Found。”
问题
如上图,没有端点监听。但是,当我转到 https://fow01003.fbce.local/webapi/ProductData.svc 时,它显示该服务正在运行,我可以检查包含它应该包含的所有信息的 wsdl。
(PS.FOW01003.fbce.local = 本地主机)。
我可以采取哪些步骤来找出真正的问题所在?
【问题讨论】:
-
您是尝试通过来自另一个虚拟机的代码连接到您的服务,还是从托管服务的同一虚拟机连接到您的服务?
-
同一台机器,webapi 通过 IIS 托管,据我所知,一切正常。
标签: c# web-services endpoint