I am using ClientBase in a proxy to call a REST over WCF service of mine using the service interface:
public class CommunicationServiceProxy : ClientBase<ICommunicationService>, ICommunicationService
I also add before each call a authorization header so my service will accept the request, like this:
private OperationContextScope AddHeader(OperationContextScope scope)
{
if (WebOperationContext.Current == null) return null;
WebOperationContext.Current.OutgoingRequest.Headers.Add("Authorization", Header);
return scope;
}
Everything is working fine, but now, because of security resons, I need to generate a signature of the request URL(eg. http://myservice/contact/getstatus?id=1), the problem is how to get this URL when using a proxy class like the one above, seens like WebOperationContext.Current.OutgoingRequest is missing this information.
Anyone have managed to get this? What are my options here?
Thanks
The solution I found is to use WCF extensions, more specificly IClientMessageInspector, there I have all the information I need to generate the signature.