Have been experimenting with hosting a WCF service in a Worker Role for days and I am so happy that I finally managed to get it working on the Cloud. I basically relied on the WindowsAzureRoleCommunication lab that came with the Windows Azure Training Kit for guidance.
It was silly (and greedy) of me to try to host a HTTP endpoint in a Worker Role. Now, that it is on TCP, everything works fine. Sigh! Still a lot to learn ^_^'
Anyway, I didn't like the idea of defining the service programmatically, so I proceeded to use the app.config file in the Worker Role but included these lines of code in the host instead:
RoleInstanceEndpoint tcpEndpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["tcpIn"];
_svcHost = new ServiceHost(typeof(ExpenseService),
new Uri(String.Format("net.tcp://{0}/ExpenseService",
tcpEndpoint.IPEndpoint)));
where tcpIn is defined in the csdef file.
Home » Windows Azure » My Worker Role is Alive!
Popular Post
-
S6 / 2.788 cc / 170 PS / 174 lb/ft (235 Nm) @ 3.700 / Vmax: 130 mph (210 km/h) (click images for a larger view)
-
Photo: Diane Edwardson, February 28, 2012, 9:33 AM. This is the only shot I got of the Kestrel sitting atop one of the young California Bla...
-
V8 / 4.973 cc / 231 PS / Vmax: 146 mph (235 km/h) (click images for a larger view)
-
After attending my presentation on SQL Azure Data Sync, my DBA was a little disappointed when I mentioned that SQL Azure Data Sync does not ...
-
Photo: Diane Edwardson, June 15, 2012. This may be the last photo of Red Tailed Hawk Baby #4 in the nest. (Click on photos to enlarge.)...
-
V8 / 4.700 cc / 700 PS / 627 lb/ft (850 Nm) / Vmax: 230 mph 370 km/h (click images for a larger view)
-
Come race at Bud's HO in Cortlandt Manor New York during a Carrera Race Day event Sunday August 15th . Prizes, food and naturally... ra...
-
Photo: Diane Edwardson, September 23, 2011, 6:26 PM. A giant spider dropped from the clouds on Corralitas Drive. (Click on photo to enlar...
No comments:
Post a Comment