Note that there are some explanatory texts on larger screens.

plurals
  1. POTCP error code 10013 Cross Domain Policy Error with netTcpBinding Service and Silverlight Client
    primarykey
    data
    text
    <p>Was wondeirng if anybody could get me out of my cross domain policy hell.</p> <p>I have a duplex WCF service which uses <code>netTcpBining</code>, and the client is a Silverlight 4 app. When I self host the service, then it works perfectly and my Silverlight clients can consume the service with no problems. However when I host it in IIS 7, that's when the trouble starts. When I host it in IIS I'm able to see the service at:</p> <p><code>http://localhost/Conference/VideoConferenceService.svc</code></p> <p>And when I add a reference to the service which is hosted in IIS, and try to call it, I get a:</p> <blockquote> <p>CommunicationException: Could not connect to net.tcp://localhost/Conference/VideoConferenceService.svc. The connection attempt lasted for a time span of 00:00:03.3071892. 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.</p> </blockquote> <p>Or if seeing the actual error helps inspire those who have seen it before, here is what it throws at me in <code>Reference.cs</code>:</p> <p><img src="https://i.stack.imgur.com/4rhh0.png" alt="enter image description here"></p> <p>I have checked out almost every solution suggested regarding solving the cross-domain policy error, and I've put my <code>clientaccesspolicy.xml</code> in my default website root in IIS, and also in <code>wwwroot</code>. I've also turned off all my firewalls. I'm able to see the policy at <code>http://localhost/clientaccesspolicy.xml</code> and also at <code>http://127.0.0.1/clientaccesspolicy.xml</code> but I still get this error. </p> <p>Here is my web.config for the service hosted in IIS 7:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;configuration&gt; &lt;runtime&gt; &lt;gcServer enabled="true" /&gt; &lt;/runtime&gt; &lt;system.web&gt; &lt;compilation debug="false" /&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="VideoServer.VideoConferenceService"&gt; &lt;endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IVideoConferenceService" contract="VideoServer.IVideoConferenceService" /&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="net.tcp://localhost:4502/VideoServer/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; &lt;/services&gt; &lt;bindings&gt; &lt;netTcpBinding&gt; &lt;binding name="NetTcpBinding_IVideoConferenceService" portSharingEnabled="true" transactionFlow="false" transferMode="Buffered" listenBacklog="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="24.20:31:23.6470000" openTimeout="24.20:31:23.6470000" receiveTimeout="24.20:31:23.6470000" sendTimeout="24.20:31:23.6470000"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt; &lt;reliableSession enabled="false" /&gt; &lt;security mode="None"&gt; &lt;message clientCredentialType="None" /&gt; &lt;transport protectionLevel="None" clientCredentialType="None" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/netTcpBinding&gt; &lt;/bindings&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;serviceMetadata httpGetEnabled="False" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="False" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; &lt;system.webServer&gt; &lt;directoryBrowse enabled="true" /&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>And here is the Silverlight client's <code>ServiceReferences.ClientConfig</code> file:</p> <pre><code>&lt;configuration&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;customBinding&gt; &lt;binding name="NetTcpBinding_IVideoConferenceService"&gt; &lt;binaryMessageEncoding /&gt; &lt;tcpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /&gt; &lt;/binding&gt; &lt;/customBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="net.tcp://localhost/Conference/VideoConferenceService.svc" binding="customBinding" bindingConfiguration="NetTcpBinding_IVideoConferenceService" contract="ServiceReference1.IVideoConferenceService" name="NetTcpBinding_IVideoConferenceService" /&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre> <p>Has anybody got any suggestions? This annoying error has taken days of my time thus far. Any help would be greatly appreciated.</p> <p><strong>EDIT</strong></p> <p>When I check the files being retrieved in my web sessions using fiddler, it shows that my browser is retrieving the client access policy file, so I think the error lies somewhere else and WCF is just throwing this error at me? I've also set IE9 to clear its cache everytime its close. Take a look below.</p> <p><img src="https://i.stack.imgur.com/GYKMU.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload