UsernameToken in asp.net page as web service client
I've the following problem in generating a UsernameToken in an asp.net page that act as a client that consumes a web server.
This is the framework:
1) a web service (.net 1.1, WSE 2.0 SP3) that requires soap authentication from the client with myUsernameTokenManager implementation (no X.509 certificate)
2) a winForm client (.net 1.1, WSE 2.0 SP3) that consumes the web service passing a UsernameToken in the Soap messages (no X.509 certificate) .
3) a web client that does the same as the winForm client but with error when generating the UsernameToken to add to the SoapContext (no X.509 certificate).
Here is the piece of code:
UsernameToken tok = new UsernameToken(CurrentUser.Instance.UserID, CurrentUser.Instance.Password, PasswordOption.SendPlainText);
webServ.RequestSoapContext.Security.Tokens.Add(tok);
DerivedKeyToken dks = new DerivedKeyToken(tok);
webServ.RequestSoapContext.Security.Tokens.Add(dks);
MessageSignature sig = new MessageSignature(dks);
webServ.RequestSoapContext.Security.Elements.Add(sig);
DerivedKeyToken dke = new DerivedKeyToken(tok);
webServ.RequestSoapContext.Security.Tokens.Add(dke);
EncryptedData enc = new EncryptedData(dke);
webServ.RequestSoapContext.Security.Elements.Add(enc);
The red line generates an Exception:
WSE040: Type CLASSNAME.MyUsernameTokenManager, ASSEMBLYNAME could not be loaded.
Please check the configuration file
where CLASSNAME and ASSEMBLYNAME are the name of the "Server" class an Assembly name... very strange since i'm on the client side!
Can someone help me, of give me some hint?
Has it something to do with the impersonation of asp.net?
I already tried to insert the <impersonate = "true" > in the web.config...
Thank You.

