没有端点侦听并且错误 404
我们已经在生产服务器上部署了一个 Web 服务,但在尝试调用它时仍然收到此错误:
“没有端点正在侦听 http://www.ourProductionserver.com/ClientService.svc/mex 可以接受消息。这通常是由不正确的地址或 SOAP 操作引起的。请参阅 InnerException ,如果存在,则更多详细信息。”
当查看 InnerException 时,它会返回 404 File Not Found...
奇怪的部分是,如果我们复制/粘贴与下面的错误中给出的完全相同的 url (http://www .our Productionserver.com/ClientService.svc)在 IE 或 FireFox 中,它显示正确。呃,我们做错了什么?
我们还在本地服务器上进行了尝试,一切正常。
有人已经得到类似的东西以及如何解决它吗?
注意:抱歉我的英语不好,我通常说法语。
我们的 webconfig :
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<webHttpBinding>
<binding name="WebBinding"></binding>
</webHttpBinding>
</bindings>
<services>
<service name="ourLib.ServiceImplementations.ClientActionService" behaviorConfiguration="ServiceBehavior">
<endpoint name="WebEndpoint" behaviorConfiguration="EndpointBehavior" address="" binding="webHttpBinding"
contract="ourLib.ServiceContracts.IClientActionService">
</endpoint>
<endpoint contract="ourLib.ServiceContracts.IClientActionService" address="mex" binding="mexHttpBinding"></endpoint>
</service>
<system.serviceModel>
我们的 ClientService.svc
<%@ ServiceHost Language="C#" Debug="true" Service="ourLib.ServiceImplementations.ClientActionService" %>
更新 当我们设置为完全信任时,我们发现 ISP 被设置为中等信任级别。它能改变什么吗?如果是,除了 web.config(我们已经尝试过)之外,我们还能如何更改它。
We have deployed a web service on a production server and still getting this error once trying to get a call to it :
"There was no endpoint listening at http://www.ourproductionserver.com/ClientService.svc/mex that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."
When looking into the InnerException, it return us a 404 File Not Found...
Weird part, is that if we copy/past the exact same url as giving in the error below (http://www.ourproductionserver.com/ClientService.svc) in IE or FireFox, it shows correctly. Heum, what do we do wrong?
We've also tried it on a local server and everything works fine.
Anyone alrealy get something similar and how to resolve it?
Note : Sorry for my english, I usualy talk french.
Our webconfig :
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<webHttpBinding>
<binding name="WebBinding"></binding>
</webHttpBinding>
</bindings>
<services>
<service name="ourLib.ServiceImplementations.ClientActionService" behaviorConfiguration="ServiceBehavior">
<endpoint name="WebEndpoint" behaviorConfiguration="EndpointBehavior" address="" binding="webHttpBinding"
contract="ourLib.ServiceContracts.IClientActionService">
</endpoint>
<endpoint contract="ourLib.ServiceContracts.IClientActionService" address="mex" binding="mexHttpBinding"></endpoint>
</service>
<system.serviceModel>
Our ClientService.svc
<%@ ServiceHost Language="C#" Debug="true" Service="ourLib.ServiceImplementations.ClientActionService" %>
UPDATE
We discover that the ISP is set to medium trust level when we are set to Full trust. Can it change something? If yes, how could we change it other than web.config (which we alrealy tried).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
什么是“/mex”?这是您的服务类别中的功能吗?我刚刚在我自己的 Webservice.svc 上进行了测试,但无法做到/所以我不确定你是否真的可以做到这一点...
如果你试图让客户端连接到你的服务,你应该能够只需使用 .svc URL,然后调用 .NET 生成的客户端对象上的函数。
What is "/mex"? Is that a function within your service class? I just tested on my own Webservice.svc and wasn't able to do / so I'm not sure you can actually do that...
If you are trying to get a client to connect to your service, you should be able to just use the .svc URL and then invoke a function on the .NET-generated client object.
看起来您正在尝试调用元数据交换端点 (mex),该端点仅在生成元数据 (WSDL) 时使用。我建议检查您设置服务网址的位置,并确保最后没有 mex 部分。
It looks like you're trying to make a call out to the metadata exchange endpoint (mex) which is only used when generating the metadata (the WSDL) in the first place. I would suggest checking where you set the service url and making sure you don't have the mex part on the end.
我们和 ISP 都没有找到原因,所以他们没有通过网络服务来访问数据库,而是设置了一个公共 IP 地址,这样我们就可以直接通过这个 IP 访问数据库,而不是通过网络服务。
谢谢大家,但我很想知道为什么,以防将来再次发生这种情况......
Well neither of us or the ISP find the reason why so instead of talking to the webservice to gain access to the DB, they've put a public IP Address so we can access to the Database directly via this IP instead of goin through a webservice.
Thanks you all but I would love to find out why in case this happen another time in the futur ...