Deploying A WCF Service As A Virtual Under An Existing ASMX Site

I’ve been working on a new system that will report system health both from the health of the server (CPU Usage, Memory Usage, Disk Space, etc…) and the health of the application (# of Orders, # of Errors, Inventory Levels, etc…).  The system uses a WCF service to collect all the data.  I recently got it working great on my machine.  However, deployment has been an adventure.  If you are going to use WCF please read through the following documentation before you try to deploy:

http://msdn2.microsoft.com/en-US/library/aa751792.aspx

http://msdn2.microsoft.com/en-us/library/b044b1c9-c1e5-4c9f-84d8-0f02f4537f8b.aspx

Also, remeber that you can only have one address per binding in a WCF service.  This bit me because you cannot have a WCF service hosted in IIS if you have multiple Host Headers\IP addresses defined for the the site.  I wanted to have an internal address for my WCF service so I could call the servers in my cluster individually to determine thier health.  That caused the following error:

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

So, if you ever get this error check your bindings and make sure you do not have multiple Host Headers\IP addresses defined in IIS.  Also make sure you only have one address defined per binding.

Posted in |

0 comments: