远程服务器返回404

时间:2013-03-01 09:54:04

标签: c# web-services endpoint

代码

的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。”

问题

如上所示,theres'没有端点监听。但是,当我转到https://fow01003.fbce.local/webapi/ProductData.svc时,它告诉我服务正在运行,我可以检查wsdl,它包含它应该包含的所有信息。

(PS.FOW01003.fbce.local = localhost)。

我可以采取哪些措施来找出真正的问题?

1 个答案:

答案 0 :(得分:0)

您是否已开启tracing以获取有关错误的更详细信息? 至少为服务端配置它(客户端也是一个好主意;)你可能会得到404的一些提示。