我正在尝试记录正在发送和接收的原始SOAP消息。我有一个SoapExtension
,一切都很好,但是有一个问题。我们正在使用WS-DeathStars的加密和消息签名,因此记录的是加密的SOAP消息。我需要的是找到一种方法在消息解密扩展之后和消息加密例程之前插入我的SoapExtension
。我该怎么做?
答案 0 :(得分:0)
SoapFilter
来解决,该自定义应该是过滤器链中的第一个:
public class TraceAssertion : PolicyAssertion
{
public override SoapFilter CreateClientInputFilter(FilterCreationContext context)
{
return new SoapTraceFilter();
}
public override SoapFilter CreateClientOutputFilter(FilterCreationContext context)
{
return new SoapTraceFilter();
}
public override SoapFilter CreateServiceInputFilter(FilterCreationContext context)
{
return null;
}
public override SoapFilter CreateServiceOutputFilter(FilterCreationContext context)
{
return null;
}
}
public class SoapTraceFilter : SoapFilter
{
public override SoapFilterResult ProcessMessage(SoapEnvelope envelope)
{
envelope.Save("c:\\log\\" + DateTime.Now.Ticks + ".soap.xml");
return SoapFilterResult.Continue;
}
}