Search code examples
wcfwsdl

How to change address of WSDL?


I host simple WCF service in IIS in web application.

<system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="SimpleServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
       </behavior>
    </serviceBehaviors>
  </behaviors>
<services>
  <service behaviorConfiguration="SimpleServiceBehavior" name="SimpleService">
  <endpoint address="" binding="basicHttpBinding" contract="ISimpleService" />
  <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>

When I run service hosted on http://projects.mydomain.com/application/SimpleService.svc it shows default service page with link to WSDL: svcutil.exe http://terminal.mydomain.local/application/SimpleService.svc?wsdl and so on

Clients can create service reference but fail to execute methods because cannot resolve host name terminal.mydomain.local The question is why server name is its local name 'terminal.mydomain.local' instead of 'projects.mydomain.com' ?


Solution

  • I found answer: http://forums.asp.net/p/1096811/1659596.aspx I needed to change host headers.