The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified
Asked Answered
T

2

7

I am getting the following error and I am not sure what I am doing wrong. Does anybody see anything obvious? Below are my project's Web.config and my WCF class library's App.config

The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified.

APP.CONFIG ON SERVER (IN MY CLASS LIBRARY)

<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 IN WEB PROJECT

<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>
Testify answered 15/9, 2009 at 17:57 Comment(0)
P
10

Your client endpoint is missing an address.

Pleuro answered 15/9, 2009 at 18:10 Comment(0)
B
4

Just add address attribute for endpoint tag in client side(consuming end).

Bushelman answered 18/4, 2011 at 9:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.