> WSE2 documentation says that "SOAP message senders can add security tokens to
> either the PolicyEnforcementSecurityTokenCache or directly to the SoapContext
> for the SOAP message when policy is used for outgoing SOAP messages." What is
> the difference whether I use PolicyEnforcementSecurityTokenCache or
> SoapContext when adding security tokens in my web service client? Which one
> should I use and why?
The Policy engine obeys instructions encoded as assertions. When these
assertions refer to a security token, the policy engine will try to find
a matching token and use it to perform either the sign or encrypt
operation and, optionally, inject the token into the message.
When searching for a token, the policy engine will look in the
SoapContext for the security token and, if it is not found, will then
search the PolicyEnforcementSecurityTokenCache for a match.
This is why placing the token in either location will work; placing it
in the PolicyEnforcementSecurityTokenCache has the benefit that your
application can perform this operation one time rather than per proxy /
per message.

Signature
This posting is provided "AS IS", with no warranties, and confers no rights.
Maksim Izbrodin - 06 Oct 2004 10:11 GMT
Thank you, Hervay! Now it's clear the difference. I didn't think that the
cache was shared among all the proxies I was using in my application.