首页 新闻 会员 周边

Redirect the wcf service request to a internal address

0
悬赏园豆:100 [待解决问题] 解决于 2011-04-15 16:58

Hi guys,

Now i have a public Wcf REST service A, and several internal wcf services, each of internal services is identified by name. Is it possible to create a router/proxy in service A, and then, when the users request the interface of service A, it can redirect the request to the internal services based on name?

I tried using:

WebOperationContext.Current.OutgoingResponse.Location = targetInternalPath;

WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Redirect; // or MovedPermanently

All works fine except the headers that we get on the client side, Here is the details from Fiddler:

In other words, the client knows the exact internal address, the content-type and content-length is incorrect. All are not what i want. I have been struggling with this issue for days, anybody has any idea?

Best Regards.

Johnny

craystall的主页 craystall | 初学一级 | 园豆:104
提问于:2011-03-31 16:58
< >
分享
所有回答(1)
0

i don't get your idea,

if you want to check content-type or context-length , you can validate input parameters in your coustom ServiceBehavior,

if you use url router , it is impossible  client know your internal address by public address

wcf 4.0 RESTful service already support this feature.

BTW you can set httpStatusCode after validation.

听说读写 | 园豆:777 (小虾三级) | 2011-03-31 18:29
Thanks for your reply, in a short word, how to route the WCF Rest service without exposing the internal addresses. I'm not sure whether the System.Web.Routing is helpful.
支持(0) 反对(0) craystall | 园豆:104 (初学一级) | 2011-04-01 09:28
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册