Net TCP liaison: L'URI préfixe n'est pas reconnu

C'est vraiment m'énerve pour un couple d'heures. J'ai créé la plus simple de service WCF à l'aide d'une liaison TCP.

namespace WcfTcpService
{
    public class TestTcpService : ITestTcpService
    {
        public string Hello(string name)
        {
            return "Hello, " + name + "!";
        }
    }
}

namespace WcfTcpService
{
    [ServiceContract]
    public interface ITestTcpService
    {
        [OperationContract]
        string Hello(string name);
    }
}

Web.fichier de configuration a la suite de l'article:

  <system.serviceModel>
    <services>
      <service name="WcfTcpService.TestTcpService" behaviorConfiguration="TestServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:808/WcfTcpService.TestTcpService" />
          </baseAddresses>
        </host>
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="tcpBinding" contract="WcfTcpService.ITestTcpService"></endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange"></endpoint>
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding name="tcpBinding" portSharingEnabled="true">
          <security mode="None"></security>
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="TestServiceBehavior">
          <!-- 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" />
      <add binding="netTcpBinding" scheme="net.tcp" />
    </protocolMapping>-->    
    <!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />-->
  </system.serviceModel>

Ce service est hébergé dans IIS:

Net TCP liaison: L'URI préfixe n'est pas reconnu

Maintenant, lorsque vous essayez d'ajouter une référence à net.tcp://localhost:808/WcfTcpService.TestTcpService partir d'une application cliente, je reçois l'erreur:

The URI prefix is not recognized.
Metadata contains a reference that cannot be resolved: 'net.tcp://localhost/WcfTcpService.TestTcpService'.
The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/WcfTcpService.TestTcpService' is unavailable for the protocol of the address.
If the service is defined in the current solution, try building the solution and adding the service reference again.

Le net.tcp service est en cours d'exécution, je reçois le même message d'erreur avec WcfTestClient.exe. et je peux réussir à exécuter http://localhost/WcfTcpService/TestTcpService.svc.

J'ai cherché sur google mais rien n'est venu.

Merci!

EDIT:

Les liaisons écran de l' "Default Web site" ressemble à ceci btw:

Net TCP liaison: L'URI préfixe n'est pas reconnu

  • Vous obtenez cette erreur lorsque vous choisissez "Ajouter une référence de service"? Essayez l'adresse localhost/WcfTcpService/TestTcpService.svc dans cette boîte de dialogue.
  • Vérifiez les liaisons dans iis/iis express le Voir, cette question: stackoverflow.com/questions/3188618/enabling-net-tcp
  • Vous avez à me faire marcher ... qui fonctionne. Si vous publiez cette solution, je vais l'accepter. Merci!
  • Vous avez probablement été trop tard pour voir mon edit juste après que j'ai posté ma question, mais les liaisons étaient correctes. Merci quand même!
  • Ajout de la réponse si d'autres trouveraient la solution facilement
InformationsquelleAutor Nullius | 2013-07-26