IDispatchMessageInspector::AfterReceiveRequest Name of call service
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.
精彩评论