﻿<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- 部署服务库项目时，必须将配置文件的内容添加到主机的
  app.config 文件中。 System.Configuration 不支持库的配置文件。 -->
  <system.serviceModel>
    <services>
      <service name="$safeprojectname$.Service1" behaviorConfiguration="$safeprojectname$.Service1_ServiceBehavior">
        <host>
          <baseAddresses>
            <!-- 在服务终结点托管服务之前，必须在相应的路径 -->
            <add baseAddress = "$servicebusbaseaddress$" />
            <add baseAddress = "http://localhost:8732/Design_Time_Addresses/$safeprojectname$/Service1/" />
          </baseAddresses>
        </host>
        <!-- 创建服务总线队列 -->
        <!-- 除非完全限定，否则地址应相对于上面提供的基址 -->
        <endpoint address ="" binding="netMessagingBinding" contract="$safeprojectname$.IService1" behaviorConfiguration="$safeprojectname$.Service1_EndpointBehavior">
          <!-- 
              在部署时，应该删除或替换以下标识元素以反映 
              在其下运行已部署服务的标识。如果删除了标识元素，WCF 将自动推断出一个适当的
              标识。
          -->
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <!-- 元数据终结点 -->
        <!-- 服务使用元数据交换终结点向客户端描述自身。 -->
        <!-- 此终结点不使用安全绑定，因此应在部署前对此终结点进行保护或将其删除 -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="$safeprojectname$.Service1_ServiceBehavior">
          <serviceMetadata httpGetEnabled="True"/>
          <!-- 若要在发生故障时接收异常详细信息以便进行调试，
          请将以下值设置为 true。在部署之前设置为 false，
          以避免公开异常信息 -->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="$safeprojectname$.Service1_EndpointBehavior">
          <transportClientEndpointBehavior credentialType="SharedSecret">
            <clientCredentials>
              <sharedSecret issuerName="$issuername$" issuerSecret="$issuersecret$" />
            </clientCredentials>
          </transportClientEndpointBehavior>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <extensions>
      <bindingExtensions>
        <add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </bindingExtensions>
      <behaviorExtensions>
        <add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </behaviorExtensions>
    </extensions>
  </system.serviceModel>
</configuration>
