0
votes

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 :

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.

Please help me out.

3
Are your service and web site hosted on the same machine?tobias86
no my wcf service is hosted in windows serviceahobul
I see, and I take it then that the service is on another machine. Are the two machines on different domains (most likely with a firewall separating them)? If so, you need to open up a port on the firewall to allow the service call to go through.tobias86
windows service is on my local system and am running my silverlight application from visual studioahobul

3 Answers

0
votes

For same-machine connections rather make use of Named Pipe bindings.

It might help if you showed us your service and client side endpoint configurations.

EDIT: After reading up a bit on the error you're getting (here among other sites), try changing the port number from 8732 to something between 4502-4534 as the error message suggests.

0
votes

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.

-4
votes

use basicHttpBinding instead of netTCPBinding