WCF 服务通过 net tcp 托管在 Windows 服务中 [英] WCF Service Hosted in Windows Service over net tcp

查看:37
本文介绍了WCF 服务通过 net tcp 托管在 Windows 服务中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我有一个 WCF 服务,它托管在 Windows 服务中.我通过 netTCPBinding 和 Installed Windows Service 在 Windows 服务中托管了 WCF 服务.为了在我的 Silverlight 项目中访问 WCF 服务,我添加了 wcf 的服务引用.但是,当我在 WCF 服务中调用方法时出现以下错误:

In my project I have one WCF Service which is hosted in a Windows Service. I hosted the WCF Service in Windows Service over netTCPBinding and Installed Windows Service. To access WCF service in my silverlight project I have added service reference of wcf. But, when I am calling a method in WCF Service am getting the following error :

无法连接到net.tcp://localhost:8732/WCFHost/.
连接尝试持续了一段时间跨度为 00:00:03.2951885.
TCP 错误代码 10013:试图以禁止的方式访问套接字它的访问权限..
这可能是由于尝试访问服务以跨域的方式,而服务未配置跨域访问.你可能需要联系服务的所有者公开套接字跨域策略通过 HTTP 并将服务托管在允许的套接字端口范围为 4502-4534.

Could not connect to net.tcp://localhost:8732/WCFHost/.
The connection attempt lasted for a time span of 00:00:03.2951885.
TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permissions..
This could be due to attempting to access a service in a cross-domain way while the service is not configured for cross-domain access. You may need to contact the owner of the service to expose a sockets cross-domain policy over HTTP and host the service in the allowed sockets port range 4502-4534.

请帮帮我.

推荐答案

在服务器端和客户端保持相同的协议.可能是您正在使用不同的协议调用服务.还要检查您是否使用 nettcp,您是否可以访问托管服务的机器.

Keep same protocols at both the server and client end. May be your are calling the service with different protocols. Also check if your are using nettcp, your are having access to the machine where service is hosted.

这篇关于WCF 服务通过 net tcp 托管在 Windows 服务中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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