WCF: How do you handle the UnknownMessageReceived message?
Currently I have this:
Private Sub AamServiceHost_UnknownMessageReceived(ByVal sender As Object, ByVal e As UnknownMessageReceivedEventArgs) Handles Me.UnknownMessageReceived
m_Log.Write(m_Name & " has receive开发者_JAVA技巧d an unknown message. The message will be ignored.", Severity.ErrorTaskFailed)
End Sub
I see there is a e.Message property but I'm not sure what parts of it are safe to read.
In General, you can read any part of the message, like it's properties, headers and the contents. Is there a reason, however, you need to handle this event? In general, if this is happening it means either that you're missing something on your contract/service implementation (otherwise, it's useful for debugging, but it's not something you should really rely on).
精彩评论