ReceiveSecurityFilter不包含带0个参数的构造函数

时间:2016-04-27 09:43:59

标签: c# web-services soap

所以我在C#(Visual Studio 2015)中尝试create a custom policy assertion that secures SOAP messages,我在第一步失败了,代码看起来像这样:

using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Security;

namespace WindowsFormsApplication1
{
    class CustomSecurityServerInputFilter : ReceiveSecurityFilter
    {
        public override void ValidateMessageSecurity(SoapEnvelope envelope, Security security)
        {
        }
    }
}

我收到错误CS1729

  

' ReceiveSecurityFilter'不包含带0参数的构造函数

我现在不知道该怎么做......

1 个答案:

答案 0 :(得分:0)

我在微软forum上得到了答案:

using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Security;

namespace WindowsFormsApplication1
{
    class CustomSecurityServerInputFilter : ReceiveSecurityFilter
    {
        public override void ValidateMessageSecurity(SoapEnvelope envelope, Security security)
        {
            // do stuff
        }
        public CustomSecurityServerInputFilter(string serviceActor, bool isClient) : base(serviceActor, isClient)
        { }
    }
}