Specifying runtime address for WCF service via config

I've created a WCF library using VS2010 C#, made reference to it from other project, everithing works fine on designtime. But on runtime, as I understand it, it uses different address. So, how can I specify it?

My App.Config looks like:

  <system.web>
    <compilation debug="true" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="WcfService.Service1">
        <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:8732/Design_Time_Addresses/WcfService/MyWcf/" />
          </baseAddresses>
        </host>
        <endpoint address ="" binding="wsHttpBinding" contract="WcfService.IService1">
        </endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>
链接地址: http://www.djcxy.com/p/95884.html

上一篇: Workflow Foundation 4 WorkflowServiceHost消息关联

下一篇: 通过config指定WCF服务的运行时地址