开发者

IDispatchMessageInspector::AfterReceiveRequest Name of call service

开发者 https://www.devze.com 2022-12-23 14:12 出处:网络
I implemented IDispatchMessageInspector and in method AfterReceiveRequest I can receive name of method (action) that calling from client like this request.Headers.Action. Can I found name of service t

I implemented IDispatchMessageInspector and in method AfterReceiveRequest I can receive name of method (action) that calling from client like this request.Headers.Action. Can I found name of service that where this method was implemented? For example I have service Test and two methods Start and Stop and request.Headers.Action开发者_高级运维 for this method like this request.Headers.Action "http://bla.my.com/Start" and "http://bla.my.com/Start" How Can I found name Test and possible this or impossible?


The correct answer is request.Headers.To, because we received message from client TO web service and if we parse property TO we are going to know name of service. And instanceContext.GetServiceInstance() is created new instance of service and this incorrect behavior for return name of service.


I found suggestion: instanceContext.GetServiceInstance()returns name of service where implemented invoked method.

0

精彩评论

暂无评论...
验证码 换一张
取 消