WPF服务申请 [英] Wpf Service Application

查看:87
本文介绍了WPF服务申请的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好..,

我是WPF和Wcf中的新手.

我创建Wpf1 Application.next,我添加一个Wcf服务.

然后再次创建一个Wpf2应用程序.对该Wcf服务的this(Wpf2)应用程序调用.

hi all..,

i''m new in WPF &Wcf.

I''m create Wpf1 Application.next i add one Wcf Service.

then again create one Wpf2 Application .this(Wpf2) application call to that Wcf service.

how to do ?

推荐答案

首先,为什么要在这个问题中纠缠WPF和WCF?这些东西是无关的,不要将所有东西混在一起.听说过关注点分离吗?请参阅:
http://en.wikipedia.org/wiki/Separation_of_concerns [ http://en.wikipedia.org/wiki/Windows_services [ http://msdn.microsoft.com/en-us/library/ms685141.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/d56de412%28v = vs.110%29.aspx [ ^ ].

现在,如何使用WCF?我建议在服务应用程序中使用WCF 自托管.请参阅:
http://msdn.microsoft.com/en-us/library/ee939340.aspx [ ^ ].

要了解它如何与客户端一起使用,请参阅有关WCF托管和使用的本文:
http://msdn.microsoft.com/en-us/library/bb332338.aspx [ ^ ].

这应该足以开始.对于一些好的代码示例,您还可以执行CodeProject文章搜索.但不要将其与WPF混合使用. :-)

—SA
First of all, why would you entangle WPF and WCF in this question? These things are unrelated, don''t mix all things together. Ever heard of separation of concerns? Please see:
http://en.wikipedia.org/wiki/Separation_of_concerns[^].

Besides, even though you can host a WCF service in a windowed or other interactive application (again, it does not matter if it is WPF or not), this is not an adequate form of application user as a service (but it''s a good idea to have such interactive version of the same application, as debugging is a whole lot easier). The adequate form of application hosting any kind of services is the Windows Service:
http://en.wikipedia.org/wiki/Windows_services[^],
http://msdn.microsoft.com/en-us/library/ms685141.aspx[^],
http://msdn.microsoft.com/en-us/library/d56de412%28v=vs.110%29.aspx[^].

Now, how to use WCF? I would advise to use WCF self-hosted in the service application. Please see:
http://msdn.microsoft.com/en-us/library/ee939340.aspx[^].

To understand how can it look along with the clients, please see this article on WCF hosting and consuming:
http://msdn.microsoft.com/en-us/library/bb332338.aspx[^].

This should be enough to get started. For some good code sample, you can also perform the CodeProject article search. But not mix it with WPF. :-)

—SA


这篇关于WPF服务申请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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