2009-09-15 1 views
7

Я получаю следующую ошибку, и я не уверен, что я делаю неправильно. Кто-нибудь видит что-то очевидное? Ниже App.configСвойство Address на ChannelFactory.Endpoint было null. Конечная точка ChannelFactory должна иметь действительный адрес, указанный

The Address собственность Web.config и мой WCF библиотеки классов моего проекта на ChannelFactory.Endpoint была нулевой. Конечная точка ChannelFactory должна иметь действительный адрес .

App.config ON SERVER (в классе БИБЛИОТЕКЕ)

<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 в веб-проекте

<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> 

ответ

10

Ваш клиент конечная точка отсутствует адрес.

+0

это было легко! знак равно – burnt1ce

4

Просто добавьте атрибут адреса для тега конечной точки на стороне клиента (конец потребления).