Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net WCF Soap响应为XML_.net_Wcf - Fatal编程技术网

.net WCF Soap响应为XML

.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

我能够使用下面的代码记录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://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有什么问题?