Como acessar uma propriedade em uma classe usada para implementar o IDispatchMessageInspector em um serviço WCF (lado do servidor)?

Estou usando o WCF IClientMessageInspector para enviar informações em um cabeçalho para um serviço WCF (wsHTTP). Estou usando o IDispatchMessageInspector para receber as informações e preencher uma propriedade String.

Eu verifiquei que o cabeçalho está enviando as informações corretamente enquanto uso o FindHeader dentro do meu método específico, mas prefiro acessar a classe personalizada que possui a propriedade Token e GET o Token a partir daí, em vez de precisar fazer o FindHeader em um método separado que todos os outros métodos chamam para obter o valor do cabeçalho.

Portanto, minha pergunta é: do lado do servidor (OperationContext eu presumo) como acessar essa instância de classe que possui a propriedade Token preenchida com as informações do cabeçalho?

Aqui está o código de toda a classe abaixo:

Região "IMPORTAÇÃO"
Imports System.ServiceModel
Imports System.ServiceModel.Dispatcher
Imports System.ServiceModel.Description
Imports System.ServiceModel.Channels
Imports System.ServiceModel.Configuration
Região final
Public Class MessageInspector
    Inherits BehaviorExtensionElement
    Implements IClientMessageInspector, IDispatchMessageInspector, IEndpointBehavior

    Private Const headerName As String = "HeaderToken"
    Private Const headerNamespace As String = "urn:com.nc-software.services:v1"

    Private _token As String
    Public Property Token() As String
        Get
            Return _token
        End Get
        Set(ByVal Value As String)
            _token = Value
        End Set
    End Property

    Public Overrides ReadOnly Property BehaviorType() As System.Type
        Get
            Return GetType(MessageInspector)
        End Get
    End Property

    Protected Overrides Function CreateBehavior() As Object
        Return New MessageInspector
    End Function
Região "IEndpointBehavior"
Public Sub AddBindingParameters(ByVal endpoint As System.ServiceModel.Description.ServiceEndpoint, ByVal bindingParameters As System.ServiceModel.Channels.BindingParameterCollection) Implements System.ServiceModel.Description.IEndpointBehavior.AddBindingParameters
End Sub

Public Sub ApplyClientBehavior(ByVal endpoint As System.ServiceModel.Description.ServiceEndpoint, ByVal clientRuntime As System.ServiceModel.Dispatcher.ClientRuntime) Implements System.ServiceModel.Description.IEndpointBehavior.ApplyClientBehavior
    clientRuntime.MessageInspectors.Add(Me)
End Sub

Public Sub ApplyDispatchBehavior(ByVal endpoint As System.ServiceModel.Description.ServiceEndpoint, ByVal endpointDispatcher As System.ServiceModel.Dispatcher.EndpointDispatcher) Implements System.ServiceModel.Description.IEndpointBehavior.ApplyDispatchBehavior
    endpointDispatcher.DispatchRuntime.MessageInspectors.Add(Me)
End Sub

Public Sub Validate(ByVal endpoint As System.ServiceModel.Description.ServiceEndpoint) Implements System.ServiceModel.Description.IEndpointBehavior.Validate
End Sub
Região finalRegião "IClientMessageInspector"
Public Sub AfterReceiveReply(ByRef reply As System.ServiceModel.Channels.Message, ByVal correlationState As Object) Implements System.ServiceModel.Dispatcher.IClientMessageInspector.AfterReceiveReply
End Sub

Public Function BeforeSendRequest(ByRef request As System.ServiceModel.Channels.Message, ByVal channel As System.ServiceModel.IClientChannel) As Object Implements System.ServiceModel.Dispatcher.IClientMessageInspector.BeforeSendRequest
    Dim header As New MessageHeader(Of String)(Token)
    Dim untypedHeader As MessageHeader = header.GetUntypedHeader(headerName, headerNamespace)
    request.Headers.Add(untypedHeader)
    Return Nothing
End Function
Região finalRegião "IDispatchMessageInspector"
Public Function AfterReceiveRequest(ByRef request As System.ServiceModel.Channels.Message, ByVal channel As System.ServiceModel.IClientChannel, ByVal instanceContext As System.ServiceModel.InstanceContext) As Object Implements System.ServiceModel.Dispatcher.IDispatchMessageInspector.AfterReceiveRequest
    Try
        Dim headers As MessageHeaders = OperationContext.Current.IncomingMessageHeaders
        Dim headerIndex As Integer = headers.FindHeader(headerName, headerNamespace)
        If headerIndex >= 0 Then
            Token = headers.GetHeader(Of String)(headerIndex)
        End If
    Catch
    End Try
    Return Nothing
End Function

Public Sub BeforeSendReply(ByRef reply As System.ServiceModel.Channels.Message, ByVal correlationState As Object) Implements System.ServiceModel.Dispatcher.IDispatchMessageInspector.BeforeSendReply
End Sub
Região final

Classe final

questionAnswers(1)

yourAnswerToTheQuestion