使用WCF服务 [英] Consuming WCF services

查看:83
本文介绍了使用WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个项目,我必须使用第三方的WCF服务构建。我试图按照这个但当我点击添加服务引用时,同样的窗口打开,如这个(相同)教程..但是当我输入由服务开发者给出的URL时,它会给出错误...



错误消息:尝试在< some url =>

找到服务时发生错误(详细信息)错误明细:

Hi,
I have a project in which I have to use WCF service build by THIRD PARTY. I am trying to consume it by following way given by this but when I click on 'Add Service Reference' same window opens as in this (same) tutorial.. but when I enter url given by Service developer it gives error...

Error Message: An error(detail) occurred while attempting to find service at <some url="">
Error Detail:

There was an error downloading 'http://10.144.64.27:83/FetchManager.svc '.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.144.64.27:83
Metadata contains a reference that cannot be resolved: 'http:xyz/../abc.svc'.
There was no endpoint listening at 'http:xyz/../abc.svc' that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond http:xyz 
If the service is defined in the current solution, try building the solution and adding the service reference again.





我在浏览器中运行相同的URL及其工作但我无法将其添加到我的项目中。我使用了该链接提供的上述方法,并使用了svcutil.exe工具。记住我不是服务开发人员,我只是消费服务。任何解决方案。

谢谢大家。



I am running same url in browser and its working but I am unable to add this to my project. I used above method provided by that link and used svcutil.exe tool as well. Remember I AM NOT SERVICE DEVELOPER, I AM JUST CONSUMING SERVICE. any solution.
Thank you all.

推荐答案

Quote:

如果你可以从远程客户端机器正确访问.svc端点和?wsdl页面(而其他用户不能),我建议你尝试在同一个应用程序中放一个简单的ASP.NET aspx页面来查看是否该用户也会遇到相同的访问问题。如果网页出现相同问题,则问题不是特定于WCF,而是与远程客户端对IIS Web目录的远程访问有关。是否在IIS上启用了身份验证,或者您是否已检查是否启用了匿名身份验证?



另外,您可以检查的另一件事是您是否启用了multipleSiteBindingsEnabled设置。这有助于使您的IIS托管WCF服务能够接受各种主机名(本地服务器名和外部DNS名称...)下的请求。此设置是特定于WCF 4.0的

If you can access the .svc endpoint and ?wsdl page correctly from remote client machine(while the other users cannot), I'd suggest you try putting a simple ASP.NET aspx page in the same application to see if the same access issue also occurs for that user. If the same issue occurs for web page, the problem is not WCF specific, but is related to the remote access of the IIS web directory from remote client. Is there any authentication enabled on IIS or have you checked if anonymous authentication is enabled?

Also, another thing you can check is if you have enabled "multipleSiteBindingsEnabled" setting. This can help make your IIS hosted WCF service be able to accept requests under various host names(local servername and external DNS names...). This setting is WCF 4.0 specific





点击此处查看更多信息:无法访问托管的WCF服务


这篇关于使用WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆