Building a WCF Service? Make sure you think about how it’s hosted…

By riceboyler on Aug 19 2009 | 0 Comments

Got a bit of a wake up call this morning when I went to deploy a new WCF Service to our internal web server.  We’re going to use it for an external Resume Database to talk to, but initially it will be internal only.  Well, what I found out, rather rudely, is that if you assign multiple host headers to an IIS site for WCF, you’ll get this rather unfriendly little error:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection.

Essentially, it’s finding more than one item to bind to, so it freaks out because WCF doesn’t support multiple IIS bindings for the same protocol.  There is a work around, which is to create a ServiceHostFactory, about which more information can be found here: http://msdn.microsoft.com/en-us/library/aa702697.aspx

Maybe that’ll help me remember to do this when I switch this to an external WCF service…

Post info

Tags:
Categories: Coding Adventures , Work , WCF

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading