通过读取外部xml文件的WCF代理 [英] WCF proxy by reading external xml file

查看:80
本文介绍了通过读取外部xml文件的WCF代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过读取XML文件来创建WCF代理.到目前为止,在我的项目中,我正在使用web.config文件创建代理类.我要求我的中间服务必须与不同的服务(具有相同的合同)进行通信 具有不同的服务行为.如果我在web.config中容纳其他客户端的服务行为,将很难进行管理(假设:如果任何客户端更改了其行为,则我已经在web.config中进行了搜索,并且我应该确保该行为 不共享其他服务)

Is it possible to create WCF proxy by reading from XML file. As of now in my project i am using web.config file to create my proxy class. I have a requirement that my intermediate service has to communicate with different services (which have same contract) which have different service behavior. it will be difficult to manage if i accommodate Service behavior for different client in my web.config (suppose: if any client change its behavior, i have search through web.config and i should ensure that the behavior is not share for other services)

推荐答案

Hello Rosh,

Hello Rosh,

有,您正在朝正确的方向前进.您可以在运行时读取配置并创建WCF客户端.  基础将是使用 渠道工厂.

There is and you are heading the correct direction.  You can at runtime read the configuration and create the WCF client.  The basis will be to take control of the creation using a channel factory.

这是一篇不错的文章,您应该看看: 使用WCF ChannelFactory创建动态代理.

Here is a good article you should have a look at: Creating dynamic proxy using WCF ChannelFactory.

希望这会有所帮助!


这篇关于通过读取外部xml文件的WCF代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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