WCF (hosting service in IIS) - machine name automatically accepted by WCF, not IP?

So, I previously reported my problems when moving the WCF production service from my local machine to the development server. The problem was that when moving through all the links, the machine name was indicated, not ip. Since I did not access it in the domain, I could not see the name of the machine and could not access the links. Here is my previous post ( WCF .NET Service Links use the server name, not the IP address causing problems when using ).

I found a solution, but wanted to make sure that it was the right solution for my problem. And also ask if anyone else has any other input? The solution was to change the binding of the IIS site. I found a solution in ( http://blogs.msdn.com/wenlong/archive/2007/08/02/how-to-change-hostname-in-wsdl-of-an-iis-hosted-service.aspx ). The only thing I can do for each site is that the application I'm working with is not hosted and is the web solution installed on each site. Therefore, I may need to include a script in the assembly for each site.

I would think that I could make this change in the .config file?

0
source share
1 answer

The right way to handle this is to set and specify the host header in IIS for the website instance. Now, suppose you have only one host header applied to the website instance, which should be all you need. However, if you have several host configurations configured, you will also need to explicitly specify the WCF on which the host will expose itself through. This is done using the configuration item below the item to bind the service to this particular domain.

0
source

All Articles