2011-03-18 84 views
1

我有一個WCF,它具有自託管文件中的TCP,HTTP和Mex綁定,並且一切正常。但是,我想將它遷移到AppFabric,並保持相同的綁定,但我很難做到這一點。我添加了WCF服務應用程序,更正了svc文件,放棄了自託管控制檯應用程序,但我一直在獲取awfull 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的web服務器
下面是對自託管我以前的app.config文件:將WCF從自託管移植到IIS/AppFabric託管

<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

回答

3

IIS本身不能託管非HTTP端點。您還必須安裝(激活功能)Windows激活服務(WAS)。安裝後,您必須在IIS管理控制檯中爲您的站點啓用net.tcp綁定。

+0

是的,我知道。我已經安裝了AppFabric,WAS和整個九碼。但是,我得到的這個錯誤仍然是在使用Visual Studio的服務器進行調試時。我不是IIS。 – Pascal 2011-03-18 21:46:37

+1

如果你不想使用Net.Tcp,你必須在IIS中。 VS集成Web服務器(Cassini)僅支持HTTP端點。 – 2011-03-18 21:50:39

+0

不知道那個......: -/Tks你的時間和答案!我刪除了tcp的東西,它的工作......我會在AppFabric試試看它是怎麼回事。 – Pascal 2011-03-18 21:55:59