полностью удалено ‹system.serviceModel›, но по-прежнему возникает ошибка нескольких конечных точек http

Я получаю такую ​​ошибку: эта коллекция уже содержит адрес со схемой http. В этой коллекции может быть не более одного адреса на схему. Если ваша служба размещается в IIS, вы можете решить проблему, установив для 'system.serviceModel / serviceHostingEnvironment / multipleSiteBindingsEnabled' значение true или указав 'system.serviceModel / serviceHostingEnvironment / baseAddressPrefixFilters'.

Если я установил ‹serviceHostingEnvironment multipleSiteBindingsEnabled =" true "/›, то я получаю эту ошибку:

Когда для параметра system.serviceModel / serviceHostingEnvironment / multipleSiteBindingsEnabled установлено значение true в конфигурации, конечные точки должны указывать относительный адрес. Если вы указываете относительный URI прослушивания на конечной точке, то адрес может быть абсолютным. Чтобы решить эту проблему, укажите относительный uri для конечной точки

Итак, мой вопрос: если я полностью удалю весь раздел из файла конфигурации, я все равно получаю первую ошибку. Это означает, что IIS думает, что у меня есть несколько конечных точек, хотя в файле конфигурации нет ни одной чего-то такого. У меня новая установка IIS на сервере Windows 2012 (iis 8), страницы asp.net размещаются нормально. Приложение отлично работает как на Windows 7, так и на сервере Windows 2003 (iis 6).

Это раздел моей модели обслуживания в конфигурационном файле:

<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />    
  <service behaviorConfiguration="metadataSupport_Behaviour" name="myserver.Service.Gateway">
    <host>
      <baseAddresses>
        <add baseAddress="http://www.myserver.com.au/Service/"/>
      </baseAddresses>
    </host>
    <endpoint binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_Configuration_NoSecurity" contract="myserver.Service.IGateway"
      address="Gateway.svc" listenUri="http://www.myserver.com.au/Service/Gateway.svc">
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">
    </endpoint>
  </service>      
</services>

<bindings>      
  <basicHttpBinding>        
    <binding name="basicHttpBinding_Configuration_NoSecurity" receiveTimeout="23:10:00" sendTimeout="23:10:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="32000" maxStringContentLength="8192000" maxArrayLength="16384000" maxBytesPerRead="1024000" maxNameTableCharCount="16384000" />
      <security mode="None">
        <transport clientCredentialType="Windows" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="metadataSupport_Behaviour">
      <serviceMetadata httpGetEnabled="true" httpGetUrl="http://www.myserver.com.au/Service/Gateway.svc" httpsGetEnabled="true"
        httpsGetUrl="https://www.myserver.com.au/Service/Gateway.svc"/>
      <serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="false" httpsHelpPageEnabled="false"/>
    </behavior>

    <behavior name="basicHttp_ServiceBehavior">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>

  </serviceBehaviors>
</behaviors>

Please please help!


person Craig Day    schedule 10.05.2013    source источник


Ответы (1)


ok удалось заставить его работать, полностью удалив весь раздел servicemodel и заменив его следующим:

<system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>    
         <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

Выше приведена конфигурация службы по умолчанию из недавно созданной службы, размещенной на сервере WCF IIS .net 4.5. Это означает, что мне пришлось добавить / отредактировать это:

<httpRuntime targetFramework="4.5"/>
    <compilation targetFramework="4.5"/>
person Craig Day    schedule 11.05.2013