I've been trying to do a simple encrypted message exchange with WSE 3.0 on
.NET 2.0. All that I really want to do is encrypt the message so it can't
be intercepted en route. It's for a demonstration, so full-blown security
considerations need not be taken (it is enough to exchange a message, show a
trace, then say "voila! it's encrypted!"). I thought I could just adapt the
Security\SecureConversation sample installed with WSE 3.0. I was
disappointed that I needed multiple levels of setup to install keys and set
permissions. I have also used Indigo/WCF and can encrypt messages with *no*
extra steps. Maybe I'm missing something?
Anyway, I run the Setup.bat in the "[Program Files]\Microsoft
WSE\v3.0\Samples" folder and all is well. Then I run the
CreateSampleVdir.bat from the ...\SecureConversation\Policy folder. Again,
no errors. The sample does not run. Exception every time. If I open
http://localhost/SecureConversationPolicy/SecureConversationService.asmx
file in IE I see "Unable to connect to database. Check database connection
information and make sure the database server is running. For tips on
troubleshooting this error, search for article 823287 in the Microsoft
Knowledge Base at http://support.microsoft.com." Then I noticed that, by
default, the application also deploys to the built-in (Cassini) web server
(almost the same URL, different port). This deployment works fine. If I
modify the URL in the solution to point at that all is well. If I point to
the IIS-hosted vdir, it fails for the reason above.
I'd love to just say that I'll use the built-in web server option since it's
just a demo, but it's intended exclusively for debugging, so can't be hit
from another machine (unless there's a hack I don't know of...). The IIS
management tool shows the vdir just fine -- it just gives that error when
hitting the ASMX page. The article ID referenced in the error relates to
SharePoint which makes no sense anyway. I did confirm that the Network
Service account has permissions to SQL Server, but this should have no
dependency on that.
Any help would be very much appreciated!
-Arian
n33470 - 17 Nov 2005 14:32 GMT
Arian,
Have you tried the sample found here "C:\Program Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Security\WSSecurityUsername\Code". I've
been able to get this sample working, with no extra effort.
This demonstrates the turnkey policy called "Username Over
Certificate". This policy seems to be getting a lot of attention
because it's provides encryption at the message level rather then
relying on the transport layer (https). I'm assuming that if you get
the sample running that you'll have some kind of tracing tool to
demostrate that the soap message is *actually* encrypted.
In order to get this sample running I did need to install the X.509
certificates, which are created by the setup file found here:
"C:\Program Files\Microsoft WSE\v3.0\Samples\Setup.bat". The virtual
directories for this sample can be create with this script (although
the virtual directories are easy to setup in IIS) "C:\Program
Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Security\WSSecurityUsername\Code\CreateSampleVdir.bat"
That was all I needed to do (install certs, and create vdir) in order
to get this sample running. I have the VS2005 RTM 50727 build, and the
released version of WSE3.0 downloaded yesterday.
HTH,
--steve