WCF如何重定向客户端的请求 [英] How can WCF redirect client's request

查看:30
本文介绍了WCF如何重定向客户端的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将客户端的请求从Web服务A重定向到Web服务B.这里的目标只是更新服务器端逻辑,以便客户端可以无缝重定向到Web服务B,而无需更新哪个Web的url它应该指向的服务.

I need to redirect a client's request from web service A to web service B. The goal here is to update the server side logic only, so that the client can be redirected to web service B seamlessly without updating the url of which web service it should be pointing to.

我可以轻松地将 Web 服务 A 转为 Web 服务 B 的客户端,以便它充当位于客户端和 Web 服务 B 之间的代理.但我们的技术负责人拒绝了此选项.

I can easily turn web service A to the client of web service B so that it acts as a proxy sitting in between of the client and web service B. But our tech lead has turn this option down.

还有其他方法吗?

谢谢

推荐答案

Michele Leroux Bustamente 在 构建 WCF 路由服务,这似乎正是您想要做的事情.

There's a really good series on MSDN by Michele Leroux Bustamente on Building a WCF Routing Service which seems to be just about what you're trying to do.

目前,在 .NET 3.5 中,您必须自己完成所有这些工作.这有点工作,但绝对可以完成.

For now, in .NET 3.5, you'll have to do all of this yourself. It's a bit of work, but it can definitely be done.

在 .NET 4.0 和 WCF 4.0 中,将有一个新的内置路由服务(参见 Christian Weyer 的 博客文章),您可以将其用作服务实现的基类.它可以使用路由表以声明方式(或在代码中)进行配置..NET 4.0 应该会在 2009 年底之前发布(或者微软现在是这么说的).

With .NET 4.0 and WCF 4.0, there will be a new routing service built-in (see Christian Weyer's blog post on this) that you can use as a base class for your service implementation. It can be configured declaratively (or in code) using routing tables. .NET 4.0 should be out before the end of 2009 (or so Microsoft says for now).

马克

这篇关于WCF如何重定向客户端的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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