WCF - “没有端点监听……";错误 [英] WCF - "There was no endpoint listening at..." error

查看:20
本文介绍了WCF - “没有端点监听……";错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个应用程序要在同一台机器上进行本地测试.应用 1 有一个简单的 WCF 服务,带有以下配置条目:

I have two applications that I want to test locally on the same machine. App 1 has a simple WCF service with the folloiwng config entry:

<service behaviorConfiguration="MyNamespace.ContainerManagementServiceBehavior"
        name="MyNamespace.ContainerManagementService">
  <endpoint address="ContainerManagementService" binding="basicHttpBinding"
     name="ContainerManagementbasicHttpEndpoint"
     contract="MyNamespace.IContainer" />
  <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  <host>
    <baseAddresses>
      <add baseAddress="http://localhost:8000/ContainerManagementService" />
    </baseAddresses>
  </host>
</service>    
<behaviors>      
  <behavior name="MyNamespace.ContainerManagementServiceBehavior">
    <serviceMetadata httpGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="false" />
  </behavior>
</behaviors>

我通过运行托管它的 Web 应用程序项目来启动该服务.我能够成功浏览到 url 并从 ie 获取 Web 服务信息页面.我复制了相同的 URL 并将其用于我的客户.

I start the service by running the web application project where it is hosted. I am able to successfully browse to the url and get web service information page from ie. I copy the same URL and use it for my client.

我的另一个客户端 App 2 在其配置文件中包含以下内容:

My other client, App 2, has the following in its config file:

<system.serviceModel>
  <bindings>
    <basicHttpBinding>
      <binding name="basicHttp" closeTimeout="00:10:00"
        openTimeout="00:10:00" receiveTimeout="00:10:00"
        sendTimeout="00:10:00" allowCookies="false"
        bypassProxyOnLocal="false"
        hostNameComparisonMode="StrongWildcard"
        maxBufferSize="5242880" maxBufferPoolSize="524288"
        maxReceivedMessageSize="5242880" messageEncoding="Text"
        textEncoding="utf-8" transferMode="Buffered"
        useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192"
          maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="5242880" />
        <security mode="None">
          <transport clientCredentialType="None"
            proxyCredentialType="None" realm="" />
          <message clientCredentialType="UserName" algorithmSuite="Default" />
        </security>
      </binding>
    </basicHttpBinding>
  </bindings>
  <client>
    <endpoint
      address="http://localhost:3227/Services/ContainerManagementService.svc"
      binding="basicHttpBinding" bindingConfiguration="basicHttp"
      contract="MyService.IService" name="externalService" />      
  </client>
</system.serviceModel>

但是,当我尝试对正在运行的服务执行 WCF 调用表单客户端时,我收到以下错误消息:

However, when I try to execute a WCF call form client to the running service, I get the following error message:

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

会发生什么?

推荐答案

问题似乎是因为服务器和客户端都从 Cassini 服务器运行.我正在更改架构以在 IIS 中托管服务器端点.

It looks likes the issue is due to the fact that both server and client are being run from the Cassini server. I am changing the architecture to host the server endpoint in IIS.

这篇关于WCF - “没有端点监听……";错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆