Silverlight WCF netTcpBinding problem

Posted by JontyMC on Stack Overflow See other posts from Stack Overflow or by JontyMC
Published on 2010-05-20T14:34:01Z Indexed on 2010/06/17 17:33 UTC
Read the original article Hit count: 1036

Trying to call a WCF with a netTcpBinding via Silverlight, I am getting the error:

"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."

My WCF service is hosted in IIS7, bound to:

http://localhost.myserivce.com on port 80 and net.tcp on port 4502

I can see http://localhost.myserivce.com/myservice.svc if I browse to it (my hosts file is pointing this domain to localhost). I can also see http://localhost.myserivce.com/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>

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about silverlight-4.0