I have the same problem that is listed in the following thread.
WSDL first WCF server where client does not send SOAPAction
I performed the steps that are li
Dmitry Harnitski's answer does not work if you are debugging the service (It will give you a "This message cannot support the operation because it has been copied." error.)
This works even in debug mode:
XmlDictionaryReader GetReader(ref Message message)
{
MessageBuffer buffer = message.CreateBufferedCopy(Int32.MaxValue);
message = buffer.CreateMessage();
newMessage = buffer.CreateMessage();
XmlDictionaryReader rv = buffer.CreateMessage().GetReaderAtBodyContents();
buffer.Close();
return rv;
}
static System.ServiceModel.Channels.Message newMessage = null;
static System.ServiceModel.Channels.Message lastMessage = null;
public string SelectOperation(ref System.ServiceModel.Channels.Message message)
{
try
{
if(message == lastMessage)
message = newMessage;
XmlDictionaryReader bodyReader = GetReader(ref message);
lastMessage = message;
XmlQualifiedName lookupQName = new XmlQualifiedName(bodyReader.LocalName, bodyReader.NamespaceURI);
if (dispatchDictionary.ContainsKey(lookupQName))
{
return dispatchDictionary[lookupQName];
}
else
{
return null;
}
}
catch(Exception ex)
{
throw ex;
}
}