我有一个托管在 Windows 服务中的 WCF 服务
它使用 NetTCPBinding 并且我可以连接,我想实现新的 Silverlight 客户端来访问该服务
我已经完成了添加服务引用的常规方法,并且添加了 Empty "ServiceReferences.ClientConfig"
所以我查看了一些线程和主题,最后我为服务手动编写了我的配置
当我尝试连接它时显示此异常无法连接到 net.tcp://localhost:4502/MyService/Service。连接尝试持续了 00:00:02.2111265 的时间跨度。TCP 错误代码 10013:尝试以访问权限禁止的方式访问套接字。这可能是由于尝试以跨域方式访问服务,而该服务未配置为跨域访问. 您可能需要联系服务的所有者以通过 HTTP 公开套接字跨域策略,并将服务托管在允许的套接字端口范围 4502-4534 中。
我相信与 ClientAccessPolicy.xml 文件有关的问题
搜索后人们说我需要安装 IIS7 并且可以通过它访问文件,我已经尝试过了,但我无法让它工作
但是,我以前做过这方面的工作,但是我使用 PollinghttpBinding 没有 NetTCP,并且我创建了另一个服务合同来返回 ClientAccessPolicy 文件
我曾尝试用 PollinghttpBinding 做同样的事情,但我无法编写正确的服务配置
我的客户拒绝使用 IIS,所以我可以使用这种方式吗?我应该使用该服务的正确配置是什么?
这是我用于我的服务的配置
<service behaviorConfiguration="serviceBehavior" name="MyService">
<endpoint address="net.tcp://localhost:4502/MyService/Service" behaviorConfiguration="endpointBehavior" binding="netTcpBinding" bindingConfiguration="netTcpServiceBinding" contract="IMyService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:7000/MyService/mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
</service>
任何人都可以提供帮助吗?