Портирование WCF с самостоятельного хостинга в IIS/Appfabric Hosting

StackOverflow https://stackoverflow.com/questions/5358092

  •  27-10-2019
  •  | 
  •  

Вопрос

У меня есть WCF, в котором есть TCP, HTTP и MEX в файле с самостоятельным, и все работает отлично. Тем не менее, и я хочу перенести его в Appfabric и сохранить одинаковые привязки, но мне очень трудно это делать. Я добавил приложение WCF Service, исправил файл SVC, остановил приложение консоли самостоятельного управления, но я продолжаю получать ужасные 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 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>

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

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top