When working with SOAP messages, server-side scheduling is performed in accordance with the soap action header, which instructs the dispatcher, which is the appropriate method that should process the message.
Sometimes the action of the soap is empty or invalid (java interop).
I think that you are best off implementing IDispatchOperationSelector. In doing so, you can override the default method that the server assigns to incoming messages for operations.
In the following example, the dispatcher will map the name of the first element inside the SOAP body to the name of the operation to which the message will be sent for processing.
public class DispatchByBodyElementOperationSelector : IDispatchOperationSelector { #region fields private const string c_default = "default"; readonly Dictionary<string, string> m_dispatchDictionary; #endregion #region constructor public DispatchByBodyElementOperationSelector(Dictionary<string, string> dispatchDictionary) { m_dispatchDictionary = dispatchDictionary; Debug.Assert(dispatchDictionary.ContainsKey(c_default), "dispatcher dictionary must contain a default value"); } #endregion public string SelectOperation(ref Message message) { string operationName = null; var bodyReader = message.GetReaderAtBodyContents(); var lookupQName = new XmlQualifiedName(bodyReader.LocalName, bodyReader.NamespaceURI); // Since when accessing the message body the messageis marked as "read" // the operation selector creates a copy of the incoming message message = CommunicationUtilities.CreateMessageCopy(message, bodyReader); if (m_dispatchDictionary.TryGetValue(lookupQName.Name, out operationName)) { return operationName; } return m_dispatchDictionary[c_default]; } }
source share