2009-09-15 7 views
7

Je reçois l'erreur suivante et je ne suis pas sûr de ce que je fais de mal. Est-ce que quelqu'un voit quelque chose d'évident? Ci-dessous sont App.configLa propriété Address sur ChannelFactory.Endpoint était null. Le point de terminaison de ChannelFactory doit avoir une adresse valide spécifiée

de mon projet de bibliothèque de classes Web.config et ma WCF La propriété d'adresse sur ChannelFactory.Endpoint était nulle. Le point de terminaison de ChannelFactory doit avoir une adresse valide spécifiée.

App.Config SUR SERVEUR (Ma bibliothèque CLASS)

<system.serviceModel> 
    <services> 
     <service behaviorConfiguration="Default" name="Trezoro.WebAPI.Trade.TradeService"> 
     <endpoint address="" behaviorConfiguration="WebEPBehavior" binding="webHttpBinding" 
      contract="ITradeService" name="WebHttpBinding_ITradeService" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8080/tradeservice/" /> 
      </baseAddresses> 
     </host> 
     </service> 
     <service behaviorConfiguration="Default" name="Trezoro.WebAPI.Authentication.AuthService"> 
     <endpoint address="" behaviorConfiguration="WebEPBehavior" binding="webHttpBinding" 
      contract="IAuthService" name="WebHttpBinding_IAuthService" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8081/authservice" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="WebEPBehavior"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name="Default"> 
      <serviceMetadata httpGetEnabled="True" /> 
      <serviceDebug includeExceptionDetailInFaults="True" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

web.config WEB PROJET

<system.serviceModel> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 

    <bindings> 
     <customBinding> 
      <binding name="WebHttpBinding_IAuthService"> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" 
       messageVersion="Soap12" writeEncoding="utf-8"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      </textMessageEncoding> 
      </binding> 
      <binding name="WebHttpBinding_ITradeService"> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" 
       messageVersion="Soap12" writeEncoding="utf-8"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      </textMessageEncoding> 
      </binding> 

     </customBinding> 
    </bindings> 
     <client> 
    <endpoint binding="customBinding" bindingConfiguration="WebHttpBinding_IAuthService" 
    contract="IAuthService" name="WebHttpBinding_IAuthService" /> 
    <endpoint binding="customBinding" bindingConfiguration="WebHttpBinding_ITradeService" 
    contract="ITradeService" name="WebHttpBinding_ITradeService" /> 
    </client> 
    </system.serviceModel> 

Répondre

10

Votre point de terminaison client manque une adresse. Il suffit d'ajouter un attribut d'adresse pour la balise endpoint du côté client (ending consumer).

+0

c'était facile! =) – burnt1ce

4

Questions connexes