当我只指定net.tcp时,为什么UpdateServicereference添加HTTP端点

时间:2013-02-27 17:04:31

标签: .net wcf

当我右键单击if并选择UpdateServiceReference时,我的一个服务已经开始添加额外的HTTP端点。这会导致运行时错误,说我有重复的端点,必须按名称指定一个。我现在手动删除端点,但我想阻止它。我只想要TCP端点。

这里是服务,下面是“额外”端点

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IEmail" />
      </basicHttpBinding>
      <netTcpBinding>
        <binding name="tcpConfig" receiveTimeout="00:10:00" maxBufferPoolSize="5242880"
          maxBufferSize="1048576" maxReceivedMessageSize="1048576" />
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="NotificationBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

    <services>
      <service behaviorConfiguration="NotificationBehavior" name="PGFContracts.LiveContractsService.LiveTargetPriceAgreementService">
        <endpoint address="LivePricing" binding="netTcpBinding" bindingConfiguration="tcpConfig"
          name="TCPLivePricing" contract="PGFContracts.LiveTargetPriceAgreementService.ILivePricing" />
        <endpoint address="TpaNotification" binding="netTcpBinding" bindingConfiguration="tcpConfig"
          name="TCPTpaNotification" contract="PGFContracts.LiveTargetPriceAgreementService.ITargetPriceAgreementNotification" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8020" />
          </baseAddresses>
        </host>
      </service>
    </services>

这些是我不想要的端点,net.tcp也是正确生成的。它是服务器上的IIS设置吗?

  <endpoint address="http://xxx:8083/LiveTargetPriceAgreement/LiveTargetPriceAgreementService.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ILivePricing"
    contract="LiveTPAService.ILivePricing" name="BasicHttpBinding_ILivePricing" />
  <endpoint address="http://xxx:8083/LiveTargetPriceAgreement/LiveTargetPriceAgreementService.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITargetPriceAgreementNotification"
    contract="LiveTPAService.ITargetPriceAgreementNotification"
    name="BasicHttpBinding_ITargetPriceAgreementNotification" />

0 个答案:

没有答案