【问题标题】:WCF - There was no endpoint listening at http://xxxxx.xxxx/Service1.svcWCF - 在 http://xxxxx.xxxx/Service1.svc 没有监听端点
【发布时间】:2013-06-16 17:57:28
【问题描述】:

尝试调用 WCF 服务上的函数时,我收到错误:

There was no endpoint listening at http://XXXXXXXXXXX.xxx/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

我的 WCF 服务 Web.config

<system.serviceModel>
    <services>
      <service name="Service1" behaviorConfiguration="MyServiceTypeBehaviors">
        <endpoint contract="IService1" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyServiceTypeBehaviors">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

WCF 客户端应用程序配置

<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="MetadataExchangeHttpBinding_IService1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://XXXXXXXXXXX.xxx/Service1.svc"
        binding="wsHttpBinding" bindingConfiguration="MetadataExchangeHttpBinding_IService1"
        contract="API.IService1" name="MetadataExchangeHttpBinding_IService1" />
    </client>
  </system.serviceModel>

我已经尝试了很多设置和配置,但没有让这个工作......有人找到你认为我错过的任何东西吗?

编辑:我在 IIS 上托管服务并使用 Winform 客户端

【问题讨论】:

  • 您如何托管服务?
  • 我在 IIS 上托管服务并使用 Winform 客户端
  • 你在哪里得到错误?从客户端或当您尝试通过浏览器打开时?
  • 当我调用服务上的函数时,我在客户端得到它。
  • 尝试禁用防火墙并对其进行测试,看看是否是问题所在。

标签: c# wcf http


【解决方案1】:

您似乎对服务端点和 mex 端点感到困惑。它们是单独的端点。 将服务器上的配置更改为:

 <endpoint contract="IService1" binding="wsHttpBinding" address="" />
 <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />

然后重新创建代理。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-14
    相关资源
    最近更新 更多