When you query the WSDL of a WCF service that is hosted with HTTPS the location of the service will be pointed to the machine name by default. So if a client is querying your service by pointing to https://www.yourdomain.com/YourService/Service.svc?wsdl the WSDL will come back with something like this:

Therefore the client machine will not be able to generate the appropriate proxy because it will never be able to query the service using the MachineName (it is most likely sitting outside of the server's internal network).

To fix this all you have to do is add an HTTPS Host Header to the correct website. Unfortunately, this is not doable through the GUI, but it can be done in command line. To do so in IIS 6.0 run the following script by replacing the <website id> with your website id (usually it is 1) and <host header> with your fully qualified domain:

How do you determine your website id? When I do a "... get /w3svc/1/servercomment", it says "Default Web Site", hence, this is dealing with my non-customized site. I have another web site that is the customized version, but when I try /w3svc/2/servercomment, it gives an error trying to get the object, as if that website doesn't exist. So how do I change settings for my other website?

I've been tearing my hairout in trying to resolve this WCF service issue.

Firstly, I thought it was a namespace issue so I did a bit of reading and found out I needed to add the namespace for the class [ServiceBehavior] and interface [ServiceContract].

Secondly, with that resolved, I hit this issue with the server-name being used instead of the actual registered .com domain-name, again I played around with the web.config thinking that there must be something I've not configured, so I did a bit more reading, added the 'bindingName' attribute and full qualifing url of the server into the <endpoint> and found out this still did not work. However, at least I got all the namespaces showing what I wanted except the problem with the service still showing the server-name *bangs head against wall* ... so, I searched the web again and did more reading and found this article by Jonas, and the following microsoft blog:

Add comment

I am a husband, father of three and a Microsoft Most Valuable Professional (MVP) and a Microsoft Certified Application Developer (MCAD) with over a decade of experience building and architecting .NET applications and even more years of professional experience using Microsoft development technologies such as ASP, Visual Basic, and SQL Server. I have worked in several markets such as insurance, real estate, leasing, medical, hospitality, among many others.