【问题标题】:DevForce ServerConsole - There is no end point listeningDevForce 服务器控制台 - 没有端点监听
【发布时间】:2014-08-26 00:13:15
【问题描述】:

我有一个使用免费 Windows 应用商店许可证的基本 DevForce Windows 应用商店应用程序。

当作为 Web 项目运行时,我能够成功执行查询。

但是,当使用 ServerConsole.exe 托管时,出现以下异常:

没有端点监听 http://localhost:63191/EntityService.svc/winrt 可以接听电话 从这个应用程序。如果在 Visual Studio 中运行,请确保 为 web 中的所有 IdeaBlade 程序集引用设置 CopyLocal=true 项目以确保将这些程序集复制到 bin 文件夹中。 还要检查 global.asax 是否包含注册 DevForce 的代码 VirtualPathProvider,或者那个EntityService.svc和 EntityServer.svc 文件存在。
要检查服务是否正在运行,请打开您的互联网浏览器并 导航到http://localhost:63191/EntityService.svc。如果服务 页面显示错误,这些应该有助于诊断问题 服务。如果服务正在运行,那么还要确保 客户端和服务器之间的端点绑定匹配,并且 服务器的 ClientApplicationType 要么是“全部”,要么是正确的 客户。查看服务器的调试日志文件以获取更多信息。

解决方案中有三个项目,App1(Windows 应用商店)、DomainModel(NET4.5)和 App1.Web(Web 应用程序)。 ServiceConsole.exe 被复制到 DomainModel 的输出目录中。

ServerConsole 正确报告:

Trying programmatic configuration of EntityService using
ideablade.configuration  section EntityService listening on
http://localhost:63191/EntityService/winrt EntityService listening on
http://localhost:63191/EntityService/wp Press <Enter> to exit server.

导航到

`http://localhost:63191/EntityService.svc` shows `404 Not Found`.

`http://localhost:63191/EntityService` shows the standard Web Service info page.

【问题讨论】:

    标签: wcf devforce


    【解决方案1】:

    这是由于 DevForce 中的“不合理”。对于移动客户端,它默认假设 EntityService 将由 IIS 托管并自动附加 WCF 所需的 .svc 扩展名。

    要解决此问题,您可以添加 DevForce ServiceProxyEvents 类的自定义实现以去除扩展并替换 URI。

    class ClientProxy : IdeaBlade.EntityModel.ServiceProxyEvents
    {
    
        public override void OnEndpointCreated(System.ServiceModel.Description.ServiceEndpoint endpoint)
        {
            var olduri = endpoint.Address.Uri;
            var newuri = new Uri(olduri.AbsoluteUri.Replace(".svc", string.Empty));
            endpoint.Address = new System.ServiceModel.EndpointAddress(newuri);
            base.OnEndpointCreated(endpoint);
        }
    }
    

    将类放在将由 DevForce“探测”的客户端程序集中。

    【讨论】:

    • 托管在 IIS 上是一个完全有效的假设。
    猜你喜欢
    • 1970-01-01
    • 2015-10-17
    • 1970-01-01
    • 1970-01-01
    • 2014-12-05
    • 2016-10-15
    • 2013-03-11
    相关资源
    最近更新 更多