2011-04-05 5 views
1

Parcours du didacticiel "Quoi de neuf dans WCF4.0". Le 1er exercice consiste à configurer un service sans aucune configuration. Ensuite, vous mettez en place une configuration pour fournir des métadonnées de service. Trucs simples.Configuration des points de terminaison WCF

Ce que j'ai maintenant essayé de le faire est d'élargir la config pour exposer le même contrat de service sur un port différent - dans ce cas http://localhost:9001/test

Voici ma config ...

<system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
      <behavior name="WCF4Configuration.EchoServiceBehavior"> 
       <serviceMetadata httpGetEnabled="true" /> 
       <serviceDebug includeExceptionDetailInFaults="false" /> 
      </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="WCF4Configuration.EchoServiceBehavior" name="WCF4Configuration.EchoService"> 
      <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"> 
       <identity> 
        <dns value="localhost" /> 
       </identity> 
      </endpoint>        
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
      <endpoint address="http://localhost:9001/test" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"/> 
     </service> 
    </services> 
</system.serviceModel> 

Cependant J'essaie de me connecter à ce que je reçois le message que la machine a activement refusé la connexion. Pourquoi ça ne marche pas? Et quelle adresse puis-je utiliser dans wcftestclient pour afficher le service?

Répondre

0

Essayez:

<services> 
     <service behaviorConfiguration="WCF4Configuration.EchoServiceBehavior" name="WCF4Configuration.EchoService"> 
      <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"> 
       <identity> 
        <dns value="localhost" /> 
       </identity> 
      </endpoint>        
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
      <endpoint address="" binding="wsHttpBinding" contract="WCF4Configuration.IEchoService"> 
      <host> 
      <baseAddresses> 
       <add baseAddress="http://localhost:9001/test/" /> 
      </baseAddresses> 
      </endpoint> 
     </service> 
</services> 
Questions connexes