SunQuest
 
       Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 5 - Final Steps for Security Optimization with...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Final Steps for Security Optimization with Web Services
By: MSDN Virtual Labs
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-08-03

    Table of Contents:
  • Final Steps for Security Optimization with Web Services
  • Configuring the Client for Secure Conversation
  • Exercise 5 Routing Secure Messages
  • Configuring the Client for Routing
  • Configuring the Service for Routing

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Final Steps for Security Optimization with Web Services - Configuring the Service for Routing


    (Page 5 of 5 )



     

      1. Open policyCache.config in the RoutingService project and locate the <endpoint> elements within policyDocument/mappings.
      2. Change the value of the uri attribute on each <endpoint> element to contain the same values that you used in the <appSettings> section in the previous section.

        <policyDocument
        xmlns= "
        http://schemas.
        microsoft.com/wse/2003/06/
        Policy
        ">
          <mappings xmlns:wse="
        http://schemas.
        microsoft.com/wse/2003/06
        /Policy
        ">
            <endpoint uri="
        http://localhost/router/
        submit.ashx
        "> 
              <defaultOperation>
              ...


        Note: this change is necessary because the policy mapping is driven by the value of the wsa:To header, which in this case contains the original destination before the routing takes place.

        Note: The policyCache.config file may have been built with a different machine name for the wse:Role elements for authorization checking. If this is the case, please check each of the wse:Role elements and confirm that the correct machine name has been supplied.

      3. Right click ViewInvoices.asmx and select View Code
      4. Add a using statement to the top of the file for Microsoft.Web.Services2. Messaging:

        ...
        Imports Microsoft.Web.Services2. Messaging
        ...
         
      5. Add a SoapActor attribute to the ViewInvoices class specifying the router URL that the message will travel through, as illustrated here:

        <WebService([Namespace]:="http://example.
        org/invoices
        "),
         SoapActor("
        http://localhost/router/view.
        ashx
        ")> 
        Public Class ViewInvoices
           ...
        End Class


        Note: WSE checks the value of the URL and the wsa:To header and when they don't match (like in this case) it throws an exception. The [SoapActor] attribute indicates that it may pass through an intermediary node.

      6. Repeat the last two steps for each of the .asmx endpoints in the RouterService project (ApproveInvoice.asmx, PayInvoice.asmx, and SubmitInvoice.asmx).
      7. Build the solution. 
      8. Run the client and verify that everything works going through the intermediary router.

        Note: in this example, the SOAP messages travel securely (with security tokens, signatures, and encrypted data found in the message) through the intermediary router and onto the ultimate receiver. This illustrates the end-
        to-end security model offered by the WS-Security framework.

     

    Lab Summary

    WSE 2.0 provides a framework for securing Web services either through code or through declarative policy files. The exercises in this lab showed you how to secure your Web services with authentication, integrity, and privacy through the built-in implementations of today's industry standard specifications.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · We hope you found this lab from MSDN Virtual Labs to be entertaining and...
     

    VISUAL BASIC.NET ARTICLES

    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway