无自动生成的代理创建WCF客户端 [英] Create WCF Client without auto generated proxy

查看:125
本文介绍了无自动生成的代理创建WCF客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看着

WCF的ChannelFactory VS生成代理

看来,在创造一个WCF客户端最好的做法是创建一个代理(不自动生成)。

appears that the best practice in creating a WCF client is to create a proxy (Not autogenerated).

我一直在寻找在线一段时间,我没有发现任何完整的例子(Proxy类的web.config)

I've been looking online for a while and i didn't find any complete example(Proxy class, web.config)

莫非你提供一个例子或资源的链接?

Could you provide an example or links to resources?

感谢

推荐答案

这文章是关于你问什么,我相信:

This article is about exactly what you're asking, I believe:

WCF的手工方式......一条正确的路

已经一致认为,虽然手动创建你的代理服务器可能并不总是最好地利用你的时间。文章进入这样做一些伟大的原因 - 你一定会拥有更多的控制权,你的客户可能更容易时间等但总体而言,手工做这样的事情,这将需要更多的时间,并解释给用户的服务究竟如何使用您提供可能是一个痛苦的代理服务器。

Having shared that, though, creating your proxies manually is probably not always the best possible use of your time. The article goes into some great reasons for doing so - you'll certainly have more control, your clients may have an easier time, etc. but overall, doing things manually like this will require more of your time, and explaining to users of your service exactly how to use the proxy you provide may be a pain.

有一个原因,WCF允许的元数据交换和发现和VS会自动为你创建代理。

There's a reason WCF allows metadata exchange and discovery and VS will auto create proxies for you.

无论哪种方式,它是一个很酷的物品和技术值得我们学习。

Either way, it's a cool article and a technique well worth learning.

这篇关于无自动生成的代理创建WCF客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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