views:

52

answers:

1

We want to receive a GET request in www.contoso.com/Service(123) and based on some logic (token information in a custom header) redirect the request to www.contoso.com/Data/123.xml or to www.contoso.com/123_bak.xml without the client being aware of the redirection

+2  A: 

Just to be clear, you're saying you don't want to return an HTTP based redirect, correct?What you're looking for is the equivalent of ASP.NET's Server.Transfer, right? If you are hosting in ASP.NET, then you could actually go ahead and use Server.Transfer to redirect the call.

In pure WCF this would be a job for routing. You might want to check out .NET 4's RoutingService. If you can't .NET 4, then you're kind on your own as there's no built-in solution for this in 3.5. For the example you gave I'd need to know more about who owns what URLs to give the best advice. For example, is the only REST URL WCF is handling the /Service(123), but the other URLs handled by some other service?

Drew Marsh