How to configure the Windows Azure WCF service web role to work with netTcpBinding?

I have a WCF service hosted on Windows Azure, and I recently changed its contract for a Duplex contract (to support a progress bar on the client). At first I used wsDualHttpBinding, which worked well on my local machine, but was not expected to work as soon as I deployed it.

Now I'm trying to configure the service to work with netTcpBinding, but I get the error message "The specified protocol is not valid. The tcp protocol for binding with the name" Endpoint1 "is not currently 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>      
+5
source share
3 answers

Web Roles WCF TCP. WCF Worker Role.

:

- Windows Azure HTTP HTTPS ...

:

... , TCP WCF netTcpBindings

+4

, WCF Azure, -, , say net.tcp ( , IIS , , !).

+2

Let me clarify this, since the answer given by @magnus johansson is not entirely correct. Roles in Windows Azure certainly support tcp. However: The hosting of WCF services in IIS is limited to HTTP only. If you decide to create your own ServiceHostoutside of IIS, then you will not have problems with tcp.

Here's an MSDN article describing WCF hosting in IIS in more detail.

+1
source

All Articles