SL4+net.tcp通信问题

错误提示:

System.ServiceModel.CommunicationException: Could not connect to net.tcp://localhost:4503/AnalysisBLL.UserBLD. The connection attempt lasted for a time span of 00:00:00.0781250. TCP error code 10013: 试图以其访问权限所禁止的方式访问套接字。. 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. ---> System.Net.Sockets.SocketException: 试图以其访问权限所禁止的方式访问套接字。

 

 

 

策略文件:ClientAccessPolicy.xml

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
   <cross-domain-access>
      <policy>
         <allow-from http-request-headers="*">
            <domain uri="*" />
         </allow-from>
         <grant-to>
            <socket-resource port="4502-4534" protocol="tcp" />
         </grant-to>
      </policy>
   </cross-domain-access>
</access-policy>

 

解决方法:

Silverlight 4正式版调用 net.tcp 的WCF,WCF端要在80端口提供 Socket策略文件 ,最简单的就是在 80端口的IIS上放置 ClientAccessPolicy.xml

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值