WSE message body encryption on CSF for dummies:-)
Counting scenario start through "CountingScenarioApp.exe" application. When you press "createSession" button follow messages will be routed:
- CountingApp --> ServiceCatalog (ServiceCatalogGetUris)
- ServiceCatalog -->CountingApp (ServiceCatalogGetUrisResponse)
- CountingApp --> Session (CreateSession)
- Session -->CountingApp (CreateSessionResponse)
Step1: enable policy config
- open c:\program files\microsoft csf\configuration\policycache.config
- add as endpoint your CountingScenarioApp.exe application: you'll have to add something like:
<operation requestAction="http://schemas.microsoft.com/wse/2003/06/RequestDescription">
<request policy="" />
</operation>
<operation requestAction="Notify">
<request policy="" />
</operation>
<defaultOperation>
<request policy="#DefaultSecurityPolicy" />
</defaultOperation>
</endpoint>
configure session web.config, servicecatalog web.config and countingscenarioapp.exe.config files to use the correct policycache.config file, adding following code under <microsoft.web.services2> node:
<cache name="C:\Program Files\Microsoft CSF\Configuration\PolicyCache.config" />
</policy>
Follow instruction you find in "C:\Program Files\Microsoft WSE\v2.0\Samples\Sample Test Certificates\read.htm" to install "Server Private.pfx" certificate. You can also generate a brend new certificate as well.
Open policycache.config file and under <policies> ---> <Policy> ---> "EncryptMessage" set: <wssp:SubjectName>CN=WSE2QuickStartServer</wssp:SubjectName>.
I <operation requestAction="CSFSessionAckResponse">
<request policy="" />
</operation>
<operation requestAction="CSFSessionNAckResponse">
<request policy="" />
</operation>
<defaultOperation>
<request policy="#EncryptMessage" />
</defaultOperation>
</endpoint>