Get method parameters from WCF OperationContext
I'm trying to get a specific parameter value from OperationContext.Current
as part of a dependency injection binding. It appears that I can parse the RequestMessage
as an XML string to see the parameters in the SOAP request header, but this seems a little hacky to me. For example, different versions of SOAP might use slightly different ways of encoding the message in XML, and I'd rather 开发者_如何学编程not have to manage these issues myself.
WCF is obviously parsing this information out and getting the parameter values set up, so it seems like there should be some method or class somewhere that parses the request message out into an intermediate data representation, where I could find the name, type, and value of each parameter that is provided. Does anybody know a clean way to get this information from the current OperationContext?
You can get the parameters with a Parameter inspector.
精彩评论