I have a WCF Service hosted on Windows Azure and I just recently changed it's contract to be a Duplex contract (to support a progress bar on the client). I first used the wsDualHttpBinding which worked well on my local machine, but as expected failed to work once I deployed it.
I am now trying to configure the service to work with netTcpBinding, but I'm getting the error "The protocol specified is not valid. The protocol 'tcp' for the binding named 'Endpoint1' is currently not supported.".
ServiceDefinition.csdef :
<Endpoints>
<InputEndpoint name="AlertsEndpoint" protocol="tcp" port="3030" />
</Endpoints>
Web.config:
<services>
<service name="AlertsService.AlertsService" behaviorConfiguration="AlertsServiceBehavior">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcp" contract="AlertsService.IAlertsService" />
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="MexTcp" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="NetTcp" />
</netTcpBinding>
<mexTcpBinding>
<binding name="MexTcp"/>
</mexTcpBinding>
</bindings>
Web Roles
hosting WCF services doesn't support the TCP protocol.
You will need to host your WCF service in a Worker Role
.
Web Roles:
Web roles in Windows Azure provide support for the HTTP and HTTPS protocols...
Worker Roles:
...and allow the process to communicate externally using a variety of TCP-based application protocols with the WCF service by using the netTcpBindings binding
You can enable whatever bindings you like for WCF on Azure in a web role by running startup scripts to enable say net.tcp (after all its just IIS at the end of the day, although I admit its more of a pain than it should be!). Full details can be seen at this article
Let me clarify this, as the answer given by @magnus johansson is not entirely correct. Web Roles in Windows Azure most certainly do support tcp. However: Hosting WCF services in IIS are limited to HTTP only. If you choose to instantiate your own ServiceHost
outside of IIS, then you'll have no problem with tcp.
Here's an MSDN article describing WCF hosting in IIS, in more detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With