.net WCF Soap响应为XML
我能够使用下面的代码记录Soap请求.net WCF Soap响应为XML,.net,wcf,.net,Wcf,我能够使用下面的代码记录Soap请求 log.Debug( OperationContext.Current.RequestContext.RequestMessage.ToString()); 原木看起来像 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://comapry.aasda.com/" xmlns:hpis="http://schema
log.Debug( OperationContext.Current.RequestContext.RequestMessage.ToString());
原木看起来像
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://comapry.aasda.com/" xmlns:hpis="http://schemas.datacontract.org/2004/07/HPIService">
<soapenv:Header>
<Stage>Retry</Stage>
</soapenv:Header>
<soapenv:Body>
<hel:SubmitToCompany>
<hel:RequestData>
<hpis:ReferenceId>1773817</hpis:ReferenceId>
<hpis:LossDate>2014-06-02T07:20:50.202Z</hpis:LossDate>
<hpis:Status>Error</hpis:Status>
<hpis:State>CO</hpis:State>
<hpis:UserId>rtrtr</hpis:UserId>
<hpis:TransactionId>486784353</hpis:TransactionId>
</hel:RequestData>
</hel:SubmitToCompany>
</soapenv:Body>
</soapenv:Envelope>
我需要在不使用跟踪侦听器的情况下记录Soap响应。为什么不使用跟踪侦听器?这将允许您只使用WCF消息日志记录。你有什么问题?你想登录到哪里,是什么阻止你在那里登录?让它尽可能简单。更详细地说,我只需要在log4net中启用调试日志记录时记录此响应消息。好的,那么您有什么问题?需要捕获Soap响应的简单方法。请求Soap Xml:-OperationContext.Current.RequestContext.RequestMessage.ToString使用OperationContext.Current.RequestContext.RequestMessage.ToString有什么问题?