3

I'm building REST client in WCF, however can't find a way to get the current request URI from a message inspector. It is required to create a signature for custom authentication.

Ivan G.
  • 5,027
  • 2
  • 37
  • 65

3 Answers3

0

You can get it from the Message.Properties.Via property (System.Uri).

mthierba
  • 5,587
  • 1
  • 27
  • 29
-1

Hope this helps

public object BeforeSendRequest(ref Message request, IClientChannel channel)
{
            var url = (request.Headers).To.OriginalString;
}
-1

For the REST client, build it for IIS with ASP NET Compatibility enabled/required. You should be able to inspect HttpContext.Current in this scenario and discover the current request URI.

Scott Seely
  • 757
  • 4
  • 6