Contents Chapter 21: Enterprise Services 773 Transactions 774 The AciD Test Transactional Components 775 An Example of Transactions other Aspects of Transaction 791 Just-In-Time Object Pooling 792 Holding Things Up 792 Queued components 792 An Example of Queued Components Transactions with Queued Components Summary 801 Chapter 22: threading 803 What s a thread? 803 Processes, AppDomains, and Threads 805 Scheduling Thread safety and thread affinity 809 When to Use Thread Designing a Background Task 811 Interactive Applications 811 Implementing Threading 812 A Quick Tour Threading Options 815 Manually Creating a Thread 820 Shared data 822 Avoid Sharing Data Sharing Data with Synchronization 825 Synchronization Objects Summary 834 Chapter 23: XML Web Services 835 Introduction to web services 835 Early Architectural Designs 837 Application Development 837 Merging the Two with the Web 837 The Foundations of web services 838 XX
xx Contents Chapter 21: Enterprise Services 773 Transactions 774 The ACID Test 774 Transactional Components 775 An Example of Transactions 776 Other Aspects of Transactions 791 Just-In-Time 791 Object Pooling 792 Holding Things Up 792 Queued Components 792 An Example of Queued Components 793 Transactions with Queued Components 799 Summary 801 Chapter 22: Threading 803 What Is a Thread? 803 Processes, AppDomains, and Threads 805 Thread Scheduling 807 Thread Safety and Thread Affinity 809 When to Use Threads 809 Designing a Background Task 811 Interactive Applications 811 Implementing Threading 812 A Quick Tour 812 Threading Options 815 Manually Creating a Thread 820 Shared Data 822 Avoid Sharing Data 823 Sharing Data with Synchronization 825 Synchronization Objects 827 Summary 834 Chapter 23: XML Web Services 835 Introduction to Web Services 835 Early Architectural Designs 837 The Network Angle 837 Application Development 837 Merging the Two with the Web 837 The Foundations of Web Services 838 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xx
Contents The problems 839 The Other Players What all the Foundations missed Building a Web Service 844 A Realistic Example 848 Using Visual Studio 2005 to Build Web Services 848 isual Basic and System. Web Services 858 System. Web Services Namespac System. Web Services Description Namespace System. Web Services Discovery Namespace System. Web Services. Protocols Namespace Architecting with Web Services Why Web Services? 861 How This All Fits Together State Management for XML Web Services Using DNS As a Model 86 Security in Web Services 866 The Secure Sockets Laye Directory-Level Security other Types of The downside 868 State Transactions Speed and Connectivity Where We Go from here 869 Summary 869 Chapter 24: Remoting. 871 Remoting overview s72 Basic Terminology 872 Single Call, Singleton, and Activated objects 875 Implementing Remoting 879 A Simple Example 879 Using IIS As a Remoting Host 894 Interface-Based Design Summa
xxi Contents The Problems 839 The Other Players 840 What All the Foundations Missed 841 Building a Web Service 844 A Realistic Example 848 Using Visual Studio 2005 to Build Web Services 848 Visual Basic and System.Web.Services 858 System.Web.Services Namespace 858 System.Web.Services.Description Namespace 859 System.Web.Services.Discovery Namespace 860 System.Web.Services.Protocols Namespace 860 Architecting with Web Services 861 Why Web Services? 861 How This All Fits Together 862 State Management for XML Web Services 862 Using DNS As a Model 863 Security in Web Services 866 The Secure Sockets Layer 867 Directory-Level Security 867 Other Types of Security 868 The Downside 868 Security 868 State 868 Transactions 868 Speed and Connectivity 868 Where We Go from Here 869 Summary 869 Chapter 24: Remoting 871 Remoting Overview 872 Basic Terminology 872 SingleCall, Singleton, and Activated Objects 875 Implementing Remoting 879 A Simple Example 879 Using IIS As a Remoting Host 890 Using Activator.GetObject 894 Interface-Based Design 895 Using Generated Proxies 897 Summary 898 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xxi
Contents Chapter 25: windows services 899 Example Windows services 899 Characteristics of a windows service 900 Interacting with Windows Services 901 Creating a windows Service 902 he NET Framework Classes for Windows services Other Types of Windows Services Creating a windows Service with visual Basic 906 Creating a Counter Monitor Service Installing the Service Starting the Service Uninstalling the service 911 Monitoring a Performance Counter 912 Creating a Performance Counter 912 Integrating the Counter into the Service Changing the Value in the Performance Counter 914 Communicating with the Service 915 The service Controller class 916 Integrating a Service Controller into the Example 917 ore Custom Commands 919 Passing strings to a Service 921 Creating a File Watcher Writing Events Using an Eventlog Creating a File SystemWatcher Debugging the Service 927 To Debug a Service 927 Summary 929 Chapter 26: Network Programming. 931 Getting Your Message Across: Protocols, Addresses, and ports Addresses and names 933 Ports: They re Not Just for Ships Firewalls: Cant Live with Them Can 't Live without Them The System. Net Namespace 935 Web Requests(and Responses) Simplifying Common Web Requests with WebClient Creating Your Own Web Server with Httplistener Summary 963
xxii Contents Chapter 25: Windows Services 899 Example Windows Services 899 Characteristics of a Windows Service 900 Interacting with Windows Services 901 Creating a Windows Service 902 The .NET Framework Classes for Windows Services 902 Other Types of Windows Services 905 Creating a Windows Service with Visual Basic 906 Creating a Counter Monitor Service 907 Installing the Service 910 Starting the Service 910 Uninstalling the Service 911 Monitoring a Performance Counter 912 Creating a Performance Counter 912 Integrating the Counter into the Service 914 Changing the Value in the Performance Counter 914 Communicating with the Service 915 The ServiceController Class 916 Integrating a ServiceController into the Example 917 More About ServiceController 919 Custom Commands 919 Passing Strings to a Service 921 Creating a File Watcher 922 Writing Events Using an Eventlog 922 Creating a FileSystemWatcher 923 Debugging the Service 927 To Debug a Service 927 Summary 929 Chapter 26: Network Programming 931 Getting Your Message Across: Protocols, Addresses, and Ports 931 Addresses and Names 933 Ports: They’re Not Just for Ships 934 Firewalls: Can’t Live with Them, Can’t Live without Them 934 The System.Net Namespace 935 Web Requests (and Responses) 935 Simplifying Common Web Requests with WebClient 952 Creating Your Own Web Server with HttpListener 955 Summary 963 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xxii
Contents Chapter 27; visual Basic and the Internet 965 Downloading Internet Resources 965 Sockets 969 Building the Application 970 Creating Conversation Windows Sending Messages Using Internet Explorer in Your Applications 990 Windows forms and html-no problem! Summary 1000 Appendix A: The visual Basic Compiler 1001 Appendix B: visual Basic Resources 1017 Index 1019
xxiii Contents Chapter 27: Visual Basic and the Internet 965 Downloading Internet Resources 965 Sockets 969 Building the Application 970 Creating Conversation Windows 972 Sending Messages 980 Shutting Down the Application 986 Using Internet Explorer in Your Applications 990 Windows Forms and HTML — No Problem! 991 Summary 1000 Appendix A: The Visual Basic Compiler 1001 Appendix B: Visual Basic Resources 1017 Index 1019 02_575368 ftoc.qxd 10/7/05 10:47 PM Page xxiii
02_575368 ftoc.qxd 10/7/05 10:47 PM Page xxiv