Портирование WCF с собственного хостинга на хостинг IIS / AppFabric - PullRequest
1 голос
/ 19 марта 2011

У меня есть WCF с привязкой TCP, HTTP и Mex в автономном файле, и все отлично работает. Тем не менее, и я хочу перенести его в AppFabric и сохранить те же привязки, но мне очень трудно это делать. Я добавил приложение-службу WCF, исправил файл svc, удалил консольное приложение Self-Hosting, но продолжаю получать Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http]. ошибка. Какие изменения мне нужно продвинуть из моего app.config в мой файл web.config, чтобы это работало? Я даже не пытался опубликовать его на IIS, но эта ошибка, которую я получаю, связана с веб-сервером VS
Ниже приведен мой предыдущий файл app.config для самостоятельного хостинга:

<configuration>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      <bindings>
        <basicHttpBinding>
          <binding name="SimpleBinding" />
        </basicHttpBinding>
        <netTcpBinding>
          <binding name="DefaultTCPBinding" closeTimeout="01:00:00" receiveTimeout="01:00:00"
                sendTimeout="01:00:00" transactionFlow="true" transactionProtocol="OleTransactions"
                maxBufferSize="5242880" maxReceivedMessageSize="5242880">
            <reliableSession inactivityTimeout="01:00:00" />
          </binding>
        </netTcpBinding>
        <wsHttpBinding>
          <binding name="RSAlarmEvent" closeTimeout="00:01:00" openTimeout="00:01:00"
              receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
              transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
            <security mode="Message">
              <transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="" />
              <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" />
            </security>
          </binding>
        </wsHttpBinding>
        <webHttpBinding>
          <binding name="ScriptBindig" crossDomainScriptAccessEnabled="true" />
        </webHttpBinding>
      </bindings>
      <behaviors>
        <endpointBehaviors>
          <behavior name="WebScriptBehavior">
            <enableWebScript />
          </behavior>
        </endpointBehaviors>
        <serviceBehaviors>
          <behavior name="MetadataBehavior">
            <serviceMetadata httpGetEnabled="true" httpGetBinding="webHttpBinding"
                  httpGetBindingConfiguration="" />
            <serviceDebug includeExceptionDetailInFaults="true" />
            <serviceThrottling maxConcurrentCalls="64" maxConcurrentSessions="400"
                  maxConcurrentInstances="464" />
          </behavior>
        </serviceBehaviors>
      </behaviors>
      <services>
        <service behaviorConfiguration="MetadataBehavior" name="MyServer.Implementation.MyAppImplementation">
          <endpoint address="" binding="netTcpBinding" bindingConfiguration="DefaultTCPBinding"
                name="MyAppTCPEndpoint" contract="MyServer.Interfaces.IMyApp" />
          <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
                name="MyAppMex" contract="IMetadataExchange" />
          <endpoint address="ws" behaviorConfiguration="" binding="basicHttpBinding"
                bindingConfiguration="SimpleBinding" name="MyApp" contract="MyServer.Interfaces.IMyApp" />
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://desk01:9878/MyAppService" />
              <add baseAddress="http://desk01:9876/MyAppService/" />
            </baseAddresses>
          </host>
        </service>
      </services>
      <diagnostics>
      <messageLogging logEntireMessage="true"
                      logMalformedMessages="true"
                      logMessagesAtTransportLevel="true" />
    </diagnostics>
  </system.serviceModel>
</configuration>

Что мне нужно изменить?
Tks

1 Ответ

3 голосов
/ 19 марта 2011

IIS не может размещать конечные точки, отличные от HTTP.Вы также должны установить (активировать функцию) Службу активации Windows (WAS).После установки необходимо включить привязку net.tcp для вашего сайта в консоли управления IIS.

...