Have a nice day need a help from here i have securityManager Class which inherit on SendSecurityFilter class WSE3 but it returns error when it build it genarate this error please help me to solve this some one know about this class details.Thanks
Error 1 'Microsoft.Web.Services3.Security.SendSecurityFilter' does not contain a constructor that takes 0 arguments
public class SecurityManager : SendSecurityFilter { public override void SecureMessage(SoapEnvelope envelope, Security security) {
// Get an X.509 certificate for signing the SOAP message.
X509SecurityToken signatureToken = GetSecurityToken("CN=WSE2QuickStartClient");
if (signatureToken == null)
{
throw new SecurityFault("Message Requirements could not be satisfied.");
}
// Add the X.509 certificate to the header.
security.Tokens.Add(signatureToken);
// Specify that the SOAP message is signed using this X.509
// certifcate.
MessageSignature sig = new MessageSignature(signatureToken);
security.Elements.Add(sig);
// Get an X.509 certificate for encrypting the SOAP message.
X509SecurityToken encryptionToken = GetSecurityToken("CN=WSE2QuickStartServer");
if (encryptionToken == null)
{
throw new SecurityFault("Message Requirements could not be satisfied.");
}
// Specify that the SOAP message is encrypted using
// this X.509 certificate.
EncryptedData enc = new EncryptedData(encryptionToken);
security.Elements.Add(enc);
}
public X509SecurityToken GetSecurityToken(string subjectName) {
X509SecurityToken securityToken = null;
X509Store store = new X509Store(StoreName.My,
StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadOnly);
try
{
X509Certificate2Collection certs =
store.Certificates.Find(X509FindType.FindBySubjectDistinguishedName,
subjectName, false);
X509Certificate2 cert;
if (certs.Count == 1)
{
cert = certs[0];
securityToken = new X509SecurityToken(cert);
}
else
securityToken = null;
}
catch (Exception ex)
{
securityToken = null;
}
finally
{
if (store != null)
store.Close();
}
return securityToken;
}