简体   繁体   中英

WCF Service Hosted in Windows Service over net tcp

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.

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.

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.

使用 basicHttpBinding 代替 netTCPBinding

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM