.NET StockTrader 2.0 Technical Documentation

engine crawled the Web.
The web site itself may have changed. You can check the current page or check for previous versions at the Internet Archive. Yahoo! is not affiliated with the authors of this page or responsible for its content.
.NET StockTrader 2.0 Technical Documentation
.NET StockTrader Technical Documentation
Page 1


.NET StockTrader 2.0
Technical Documentation
An End-to-End Service-Oriented Sample Application
Illustrating Windows Communication Foundation and .NET
Enterprise Technologies

5/10/2008
© Microsoft Corporation 2008








This document supports the release of Windows Server
®
2008 and the Microsoft .NET Framework 3.5.
The information contained in this document represents the current view of Microsoft Corp. on the issues disclosed as of
the date of publication. Because Microsoft must respond to changing market conditions, this document should not be
interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any
information presented. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS
OR IMPLIED, IN THIS DOCUMENT.
Information in this document, including URL and other Internet Web site references, is subject to change without notice.
Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places and
events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name,
e-mail address, logo, person, place or event is intended or should be inferred. Complying with all applicable copyright laws is
the responsibility of the user. Microsoft grants you the right to reproduce this guide, in whole or in part.
Microsoft may have patents, patent applications, trademarks, copyrights or other intellectual property rights covering subject
matter in this document, except as expressly provided in any written license agreement from Microsoft, the furnishing of this
document does not give you any license to these patents, trademarks, copyrights or other intellectual property.
© 2008 Microsoft Corp. All rights reserved.
Microsoft, Windows Server, the Windows logo, Windows, Active Directory, Windows Vista, Visual Studio, Internet Explorer,
Windows Server System, Windows NT, Windows Mobile, Windows Media, Win32, WinFX, Windows PowerShell, Hyper-V, and
MSDN are trademarks of the Microsoft group of companies.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
.NET StockTrader 2.0 Technical Documentation
Page 1


Contents

Introduction .................................................................................................................................................. 3
.NET StockTrader and Standards-based Interoperability with non-Microsoft Platforms ......................... 4
Using .NET StockTrader to Compare to IBM WebSphere 6.1 ................................................................... 4
Technologies Incorporated into .NET StockTrader ................................................................................... 4
.NET StockTrader Configuration Overview ................................................................................................... 5
Brief Overview of the .NET StockTrader Configuration Management Service ......................................... 6
Storing Configuration Data in a Service Configuration Repository ....................................................... 7
Dynamic Clustering ............................................................................................................................... 8
Connection Points ................................................................................................................................. 8
Health Monitoring ................................................................................................................................. 9
.NET StockTrader Application Design ............................................................................................................ 9
.NET StockTrader Configuration Options .................................................................................................... 11
.NET StockTrader AccessMode Settings.................................................................................................. 11
.NET StockTrader OrderMode Settings ................................................................................................... 13
Useful Benchmark Comparisons ............................................................................................................. 14
.NET StockTrader Access Mode Configuration Details ............................................................................... 15
In-process invocation of the backend services ....................................................................................... 15
Design Considerations......................................................................................................................... 17
Remote invocation of backend services hosted within IIS ..................................................................... 17
Design Considerations......................................................................................................................... 19
Remote invocation of self-hosted WCF Web Services ............................................................................ 20
The .NET StockTrader Self-Host Executable ........................................................................................ 23
Design Considerations......................................................................................................................... 23
.NET StockTrader Order Mode Configuration Details ................................................................................. 25
Transaction Management for Order Placement ................................................................................. 25
Synchronous Order Processing ............................................................................................................... 26
Design Considerations......................................................................................................................... 27
TCP and Http Asynchronous Order Processing ....................................................................................... 27
Design Considerations......................................................................................................................... 31 .NET StockTrader 2.0 Technical Documentation
Page 2

WCF with MSMQ Asynchronous Order Processing ................................................................................ 32
Conclusion ................................................................................................................................................... 36


.NET StockTrader 2.0 Technical Documentation
Page 3

Introduction
The .NET StockTrader is an end-to-end sample application based on an online stock-trading
scenario. The application is a new Microsoft .NET sample application designed to illustrate the use
of the Windows Communication Foundation (WCF) technologies in an end-to-end service-oriented
architecture. As such, the application illustrates many best-practice programming practices for
.NET and WCF including the use of an n-tier, service-oriented design. As a benchmark sample and
downloadable benchmark kit, the application also illustrates best-practice programming for
building high-performance and scalable service-oriented applications using Microsoft .NET and
WCF.

Figure 1: .NET StockTrader Home Page .NET StockTrader 2.0 Technical Documentation
Page 4

.NET StockTrader and Standards-based Interoperability with non-Microsoft
Platforms
The application is functionally equivalent to the IBM WebSphere Trade 6.1 sample benchmark
application, and serves to illustrate interoperability between .NET, commercial Java EE application
servers such as IBM WebSphere; and open-source platforms including those based on Java and PHP. All
of these platforms today support both basic Web Services and Advanced Web Services based on the WS-
* standards. In .NET StockTrader 2.0, all of the services in the application are exposed, via WCF, as
industry-standard Web Services. The .NET StockTrader Web application seamlessly interoperates with
the backend Java services of the WebSphere Trade 6.1 application. Conversely, the WebSphere Trade
6.1 Web application is able to seamlessly utilize the backend services of the .NET StockTrader. In each
case, a simple endpoint configuration allows this interoperability, with no code changes required to
either application.
Furthermore, WSO2 (
http://wso2.org/interop/stocktrader
) has developed both a front end (in PHP) and
middle tier services (both in open-source Java and in open-source PHP) that fully integrate with the .NET
StockTrader, for plug and play with both services and front-ends over the WS-* standards. This
interoperability includes illustrating WS-Security for