I have an IDispatchMessageInspector which is deserializing a SAML Token contained in the SOAP message header.
To do the deserialization I am using the following code:
List<SecurityToken> tokens = new List<SecurityToken>();
SecurityTokenResolver outOfBandTokenResolver = SecurityTokenResolver.CreateDefaultSecurityTokenResolver(new ReadOnlyCollection<SecurityToken>(tokens), true);
SecurityToken token = WSSecurityTokenSerializer.DefaultInstance.ReadToken(xr, outOfBandTokenResolver);
The problem I am seeing is that the performance of the ReadToken call varies depending on the account that is running the windows service (in which the WCF service is hosted).
If the service is running as a windows domain account the elapsed time for the ReadToken call is virtually zero. When running as a local machine account the call takes about 1 second.
Can anyone shed any light on what is going on here and why the account running this bit of code makes a difference as to its performance?
View Complete Post