2009-08-31 14 views
8

Chcę użyć netTCPbinding, więc zmieniłem moją konfigurację sieciową jak poniżej. Występuje ten błąd:Usługa WCF Service netTCPbinding

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

Jak można to rozwiązać?

<services> 
    <service name="DXDirectory.DXDirectoryService" behaviorConfiguration="DXDirectory.Service1Behavior"> 
    <!-- Service Endpoints --> 
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="WindowsSecured" contract="DXDirectory.IDXDirectoryService"> 
     <!-- 
      Upon deployment, the following identity element should be removed or replaced to reflect the 
      identity under which the deployed service runs. If removed, WCF will infer an appropriate identity 
      automatically. 
     --> 
     <identity> 
     <dns value="localhost" /> 
     </identity> 
    </endpoint> 
    <host> 
     <baseAddresses> 
     <add baseAddress="net.tcp://localhost:2582/DXDirectoryService" /> 
     </baseAddresses> 
    </host> 

    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="DXDirectory.Service1Behavior"> 
     <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
     <serviceMetadata httpGetEnabled="false" /> 
     <!-- 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" /> 
     <serviceAuthorization principalPermissionMode="UseWindowsGroups" /> 
     <!--<serviceCredentials>--> 
     <!--<userNameAuthentication userNamePasswordValidationMode="Custom" 
           membershipProviderName="CustomUserNameValidator"/>--> 
     <!--</serviceCredentials>--> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
+0

Chcesz wiedzieć znacznie więcej o netTcpBinding w WCF ... wizyta ten link ma wiele informacji .. http://www.planetofcoders.com/nettcpbinding-in-wcf/ –

Odpowiedz

5

HMm ... dodałeś adres bazowy do swojej sekcji services/host ok.

Szybkie pytanie: czy jesteś samonastępny lub hostujesz w IIS? Która wersja IIS?

Usługi IIS5/6 obsługują wyłącznie połączenia HTTP - nie można hostować protokołu NetTCP w IIS 5/6.

W IIS7 należy ręcznie wykonać serię kroków, aby włączyć powiązania inne niż HTTP, ale jest to możliwe. Zobacz this MSDN article, jak to osiągnąć.

Samo-hosting jest najlepszą opcją - otrzymujesz wszystkie powiązania i masz całkowitą kontrolę nad hostowaną usługą.

Marc

+0

Używam samodzielnego hostingu i IIS 7 –

+0

rry Marc, używam IIS 5.1 –

+0

Jak już wspomniałem - IIS5 * nie * będzie działał z powiązaniem NetTCP - w tym przypadku musisz użyć samo-hostingu. Czy masz ten sam błąd w samo-hostowaniu? –

0

cant patrz sekcja w pliku konfiguracyjnym, może u proszę proszę dodaj to

<netTcpBinding> 

<binding name="WindowsSecured"> 
<security mode="none"/> 
</binding> 

</netTcpBinding>