Wcf ChannelFactory.Endpoint上的Address属性为null。渠道工厂';s终结点必须指定有效地址

Wcf ChannelFactory.Endpoint上的Address属性为null。渠道工厂';s终结点必须指定有效地址,wcf,endpoint,channelfactory,Wcf,Endpoint,Channelfactory,我得到以下错误,我不知道我做错了什么。有人看到什么明显的东西吗?下面是我的项目的Web.config和我的WCF类库的App.config 上的Address属性 ChannelFactory.Endpoint为null。这个 ChannelFactory的终结点必须具有 指定的有效地址 服务器上的APP.CONFIG(在我的类库中) WEB项目中的WEB.CONFIG <system.serviceModel> <serviceHostingEnvironment a

我得到以下错误,我不知道我做错了什么。有人看到什么明显的东西吗?下面是我的项目的Web.config和我的WCF类库的App.config

上的Address属性 ChannelFactory.Endpoint为null。这个 ChannelFactory的终结点必须具有 指定的有效地址

服务器上的APP.CONFIG(在我的类库中)


WEB项目中的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>


您的客户端终结点缺少地址

只需为客户端(消费端)中的端点标记添加地址属性即可

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