Security header problem with WCF ( Framework 4.0)
—————————————————————
Hi all,
Currently I use following web method to add security header of Repository Service API.
private static void addSecurityHeader(Microsoft.Web.Services3.WebServicesClientProtocol service)
{
UsernameToken userToken = new UsernameToken(AuthenticationUtils.UserName, AuthenticationUtils.Ticket, (PasswordOption)2);
//service.RequestSoapContext.
service.RequestSoapContext.Security.Timestamp.TtlInSeconds = (long)100;
service.RequestSoapContext.Security.Tokens.Add(userToken);
}
However it trows me error when I changed to WCF because of RequestSoapContext.Security is obsolete. If I remove that header I got an exception {"WSDoAllReceiver: security processing failed (actions mismatch)"}".
Is there any way to replace for the header?