1

Suppose we have the following Service contract:

[ServiceContract]
public interface IPing
{
    [OperationContract]
    string Ping(string parameter1, string parameter2);
}

I'm wondering, how it would be possible to find a particular parameter value, say the value of parameter1 for example, in the System.ServiceModel.Channels.Message created server side.

Thanks!

charfeddine.ahmed
  • 526
  • 2
  • 8
  • 16

1 Answers1

1

It's the task of the IDispatchMessageFormatter to convert between the operation parameters and the Message object. Usually the message is created with a XML body, and the parameters are XML elements, but that's just one possible implementation (it's perfectly valid for a formatter to completely disregard the message and assign whatever values it sees fit for the operation parameters).

You can learn more about message formatters in the blog post at http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/03/wcf-extensibility-message-formatters.aspx.

carlosfigueira
  • 85,035
  • 14
  • 131
  • 171