Final Steps for Security Optimization with Web Services - Exercise 5 Routing Secure Messages
(Page 3 of 5 )
Scenario
One of the major benefits of WS-Security is the fact that it's not dependent on the communication channel. The security features are designed in a transport neutral way. This makes it possible to route messages through multiple intermediaries, and perhaps over multiple protocols, in a secure way. In this exercise, you're going to use WSE 2.0's routing features to route SOAP messages through an intermediary while using various security features covered in this lab.
You'll be working in the Exercises\E\before directory.
Tasks Detailed steps
Configuring the Router
Open Windows Explorer and navigate to C:\Microsoft Hands-on-Lab\DEV-HOL34\VB\Exercises\E\before\Router.
Open referralCache.config in the Router directory and take a look at the file. This file contains referral instructions that will be used by the WSE 2.0 built-in HTTP router. For example, it specifies that when a request comes in for http://localhost/router/ view.ashx, it should be routed to http://localhost/Router Service/ViewInvoices.asmx.
Note: the Router directory was configured as a virtual directory during the setup for this lab.
Right click on referralCache.config in Windows Explorer and select Properties.
Browse to the Security tab and click Add….
Type the name ASPNET and click Check Names.
Click OK.
Allow the ASPNET account Full Control.
Click OK.
The application needs to be configured to use this referral document. Open web.config in the Router directory and verify that it contains the following httpHandler mapping for the SoapHttpRouter class:
<configuration>
<system.web>
<httpHandlers>
<add type="Microsoft.Web.Services2.
Messaging.SoapHttpRouter, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e
35"
path="*.ashx" verb="*" />
</httpHandlers>
</system.web>
...
Note: this entry maps all requests for *.ashx endpoints to the built-in SoapHttpRouter class that knows how to process referral instructions.
Next, verify that there is a referral element in the microsoft.web.services2 section, specifying the name of the referral
file:
<configuration>
<configSections>
<section name="microsoft.web.services2" type="Microsoft.Web.Services2. Configuration.WebServices Configuration, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e 35" />
</configSections>
<microsoft.web.services2>
<referral>
<cache name="referralCache.config" />
</referral>
...
</microsoft.web.services2>
...
</configuration>
Next: Configuring the Client for Routing >>
More Visual Basic.NET Articles
More By MSDN Virtual Labs