Azure: Intra-WebRole Communication (netTcpBinding) with full-IIS

I need to change some configuration parameters on the fly in a Windows Azure project - and they need to be changed using a web service call (updating the application configuration either through the api platform, or there is no option on the Azure Management site here).

The project has several roles on the Internet and workers - they all need to know about the new configuration when it changes.

The configuration is stored in reliable storage and is also cached at run time in a static variable.

My solution was to create an internal (tcp) endpoint in my roles and use it to scroll through all the roles and instances in these roles, create the client on the fly and tell the instance about the new setting. (pretty much identical: http://msdn.microsoft.com/en-us/gg457891 )

At first I started ServiceHost in the role of WebRole RoleEntryPoint ... and I was confused why everything seemed to work fine when I went through the connection (static variables, where is the correct job), but when I make another webservice calls, the static variable seemed , "forgot," to which I installed it.

This was both local and in the Azure staging environment.

At this point, I realized that since we are using the full-featured IIS mode, RoleEntryPoint and web services ran in two separate processes: one in the Azure stub and one in IIS.

"No problem". I said: I’ll just go the line of code that launches ServiceHost from my RoleEntryPoint to global.asax - at that moment ServiceHost will be launched in the same process as the rest of the site - and the static variables will be the same.

Here where I have a problem; This works fine on my local machine running in a dev environment. As soon as I turn around, I will start to receive error messages saying that the channel used to connect to the service cannot be closed because it is in an “error state”.

Question:

  • What is the difference between the Azure environment and Dev that causes this?
  • How can I fix or solve the problem?
  • - , ... wcf Azure, , - ?

:

:

  • HTTP ​​ Azure WebRoles. , script:

    start/w pkgmgr/iu: WCF-NonHTTP-;

  • -, IIS -, net.tcp. , script:

    % systemroot%\system32\inetsrv\appcmd.exe " " /enabledProtocols:https,http,net.tcp

, , .

, :

http://msdn.microsoft.com/en-us/magazine/cc163357.aspx

http://forums.iis.net/t/1160443.aspx

http://msdn.microsoft.com/en-us/library/ms731053.aspx

http://labs.episerver.com/en/Blogs/Paul-Smith/Dates/2008/6/Hosting-non-HTTP-based-WCF-applications-in-IIS7/

+5
2

(6/27/2011):

, - Microsoft ( , ) .

Azure WCF :

http://blogs.msdn.com/b/windowsazure/archive/2011/06/27/hosting-services-with-was-and-iis-on-windows-azure.aspx

, .

, MSFT .


, , :

... .

WORKER ROLES netTcpBinding . . .

WEB ROLES . netTcpBinding - , . ?

, :

  • netTcpBinding RoleEntryPoint ServiceHost.
  • WCF - SOAP/JSON/ .
  • netTcpBinding, WCF- loopback-.
  • "" WCF SSL-.

... , .

, , - , ... , , .

, YMMV.

+1

HTTP, , , , netsh, HttpListener (sheesh!). TCP . HTTP -, .

0

All Articles