How add cutom header in WCF with dynamic user values to every call?
I am consuming one java webservice with WCF client. I want to pass user related information to service in header. I have aleady gone to through thread How to add a custom header to every WCF calls?
I have implemented IClientMessageInspector interface with BeforeSendRequest() method. Now, I want to pass user related information in SOAP header like Oraganization, which may differ for every user. I have all this information in my ASP.net application, whi开发者_Go百科ch uses this service.
Is there anyway I can pass user related information to this BeforeSendRequest() method from asp.net session and build Message header before sending any request?
There are few options
- Put the information in Sessionand retrieve it inBeforeSendRequest
- Put it in HttpContext.Current.Itemsand retrieve it in `BeforeSendRequest'
- Use Thread Local Storage (http://msdn.microsoft.com/en-us/library/6sby1byh.aspx)
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论