我必须从 WCF 请求中选择特定节点 OperationContext.Current.RequestContext.RequestMessage.ToString()
问题是名称空间正在更改请求之间的前缀:
所以一旦它是:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Body>
</s:Body>
</s:Envelope>
其他时间是:
<soapenv:Envelope xmlns:mes="MessageContracts" xmlns:req="RequestMessages" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
如何确保始终正确获取 Body 节点?