客户端未与WCF服务通信 [英] clients not communicating with WCF Service

查看:82
本文介绍了客户端未与WCF服务通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在编写一个软件,该软件可以进行远程调用以进行处理.
我用于处理的WCF服务托管在Windows服务中,WCF服务似乎正在运行,因为主项目可以通过URL将其添加为Web引用.

我遇到的问题是远程调用超时,并且似乎无法调用该方法,我正在遵循 [ ^ ]用于在Windows Service中进行自我托管的MSDN教程.

其次,有什么方法可以调试WCF服务?

如果代码示例有帮助,我可以附加一些.

谢谢

Hello,
I am writing a piece of software which makes remote calls to do the processing.
The WCF service I am using for the processing is hosted in a Windows Service, the WCF service seems to be working because the main project can add it as a web reference via URL.

The problem I am having is that the remote calls time out and it doesn''t appear to be able to call the method, I am following this[^] MSDN tutorial for self hosting in a Windows Service.

Secondly is there any way of debugging the WCF service?

If a code sample would help, I can attach some.

Thank You

推荐答案

正如我最近了解到的那样,Windows服务不能使用WCF来跨越特权边界进行通信,无论使用了什么绑定,除非与它进行通信的应用都是如此.以管理员身份运行.

您可能想查看我在星期六发布的文章,当时我正尝试做与您想做的事情相同的事情.

同步-文件夹同步应用程序 [
As I recently learned, a windows service cannot use WCF to communicate across privilege boundaries, regardless of the binding used UNLESS the app it''s communicating with is run as admin.

You might want to checkout the article I posted on Saturday, where I was trying to do the same thing you want to do.

Synchronicity - A Folder Synchronizing Application[^]

The best way to debug a windows service is to create a console app that has the same core code in it (also done in the article I cited above).

EDIT (response to your comment) =============

Then you have a problem in your WCF service. If you want to debug your windows service, put the following code at the beginning of your OnStart method:

#if DEBUG
    Debugger.Launch();
#endif



您还需要将其添加到文件中:



You''re going to need to also add this to the file:

using System.Diagnostics;


这篇关于客户端未与WCF服务通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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