ServerName in WCF WSDL instead of domain name when hosted in IIS

If you have an IIS setup with multiple sites you will have problems with the urls that are used in the wsdl to include additional schemas. By default, the computer name is used for that instead of your specified domain.

This makes it hard for your callers to generate a proxy.

You can solve this by the following settings: (add the bold configurations to the web.config)

 <system.serviceModel>
   <serviceHostingEnvironment multipleSiteBindingsEnabled=”true” />
    …
    <services>
      <service name=”YourService”>
        <endpoint address=”" binding=”basicHttpBinding” contract=”YourContract”>
         <identity>
            <dns value=www.yourdomain.de />
          </identity>
        </endpoint>
      </service>

Advertisement

0 Responses to “ServerName in WCF WSDL instead of domain name when hosted in IIS”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s





Follow

Get every new post delivered to your Inbox.