Module 1: The Microsoft
.NET Platform and XML
Contents
Overview
Lesson: XML in the .NET Platform
Lesson: XML as a W3C Standard
1
2
12
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, places or events is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
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.
2001 Microsoft Corporation. All rights reserved.
Microsoft, MS-DOS, Windows, Windows NT, ActiveX, BackOffice, bCentral, BizTalk,
FrontPage, MSDN, MSN, Netshow, PowerPoint, SharePoint, Visio, Visual Basic, Visual C++,
Visual C#, Visual InterDev, Visual Studio, Windows Media, and Xbox are either registered
trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Module 1: The Microsoft .NET Platform and XML
iii
Instructor Notes
Presentation:
60 minutes
This module provides participants with an introduction to Microsoft® .NET, the
role of Extensible Markup Language (XML) in .NET, and the processes that the
World Wide Web Consortium (W3C) uses to establish Recommendations for
XML.
After completing this module, participants will be able to:
!
Define the Microsoft .NET platform and explain why XML is central to it.
!
Explain how XML standards are developed and implemented.
!
Determine which XML processors are installed.
Materials and Preparation
This section provides the materials and preparation tasks that you need to teach
this module.
Required Materials
To teach this module, you need the following materials:
ã Microsoft PowerPointđ file 2500A_01.ppt
Preparation Tasks
To prepare for this module:
!
Read all of the materials for this module.
!
Complete the practices.
!
Visit and become familiar with the Web sites mentioned.
!
Become familiar with the history of distributed computing and the evolution
of the Internet. Many participants may not be familiar with this and will
have questions.
!
Read as much as possible about .NET and watch the available videos on the
Microsoft MSDN® NetShow®. Become familiar with the various .NET sites
on and .
Module 1: The Microsoft .NET Platform and XML
1
Overview
!
XML in the .NET Platform
!
XML as a W3C Standard
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
This module provides an overview of the Microsoft® .NET platform. After this
module you will have a clear understanding of how Extensible Markup
Language (XML) and other open computing standards are used by the .NET
platform. This module also describes technologies related to XML.
Because XML is fundamental to the Microsoft .NET vision and strategy, it is
important to understand why XML is so central and how it is established. To
this end, you will learn about the World Wide Web Consortium (W3C)
standards and Recommendation development process and how this fits in with
Microsoft’s development of XML processors.
Objectives
After completing this module, you will be able to explain:
!
Define the Microsoft .NET platform and explain why XML is central to it.
!
Explain how XML standards are developed and implemented.
!
Determine which XML processors are installed.
2
Module 1: The Microsoft .NET Platform and XML
Lesson: XML in the .NET Platform
!
What Is the .NET Platform?
!
Standards Used in XML Web Services
!
XML in Applications
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
.NET is a Microsoft initiative to create the next generation of software that
connects the world of information, devices, and people in a unified,
personalized way.
Lesson objectives
After completing this lesson, you will be able to:
!
Describe the Microsoft .NET platform.
!
Describe how XML fits into the .NET platform, including its role in XML
Web services and in client applications.
Module 1: The Microsoft .NET Platform and XML
3
What Is the .NET Platform?
!
.NET experiences
!
Pervasive smart clients
"
Windows CE
"
Windows Embedded 2000
"
Windows XP
!
XML Web services
!
.NET servers
!
Developer tools
"
Microsoft Visual Studio .NET
"
The Microsoft .NET Framework
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
The Microsoft .NET platform includes a comprehensive family of products,
built on XML and Internet industry standards, that provides for each aspect of
developing, managing, using, and experiencing XML Web services.
XML Web services allow applications to communicate and share data over the
Internet, regardless of operating system or programming language.
There are five areas where Microsoft is building the .NET platform today:
!
.NET experiences
!
Tools
!
Servers
!
XML Web services
!
Clients
What is a .NET
experience?
.NET experiences are XML Web services that allow you to access information
across the Internet and from stand-alone applications in an integrated way that
saves you time and money. Microsoft will deliver .NET experiences for
individuals and for businesses. Some of the products that Microsoft is
transitioning into .NET experiences are Microsoft MSN®, Microsoft bCentral™,
Microsoft .NET Passport, and Microsoft Visual Studio® .NET.
What is a smart client?
A client is any device that accesses a server. A smart device is a client that can
access XML Web services. Smart clients use Microsoft Windows® CE,
Windows Embedded, Window 2000, and Windows XP. This software powers
PCs, port computers, workstations, smart phones, handheld computers, Tablet
PCs, and Microsoft Xbox™ game consoles.
4
Module 1: The Microsoft .NET Platform and XML
What tools are available
to create .NET
solutions?
Microsoft Visual Studio .NET and the Microsoft .NET Framework supply a
complete solution for developers to build, deploy, and run XML Web services.
They maximize the performance, reliability, and security of XML Web
services.
Visual Studio .NET is the next generation of Visual Studio, built especially
for .NET. Visual Studio .NET helps developers quickly build XML Web
services and applications that scale easily, using the language of their choice.
Visual Studio .NET advances the high-productivity programming languages
Microsoft Visual Basic®, which includes new object-oriented programming
features; Microsoft Visual C++®, which advances Windows development and
enables you to build .NET applications; and C#, which brings rapid application
development (RAD) to the C and C++ developer.
The .NET Framework is a high-productivity, standards-based, multilanguage
application execution environment. It provides an application execution
environment that manages memory and addresses versioning issues. It improves
the reliability, scalability, and security of your application. The .NET
Framework consists of several parts. The Common Language Runtime is a rich
set of class libraries for building XML Web services, and ASP.NET.
What is a .NET server?
The Microsoft .NET Enterprise Servers, including the Windows 2000 server
family, make up the Microsoft .NET server infrastructure for deploying,
managing, and orchestrating XML Web services. Designed with
mission-critical performance in mind, they provide enterprises with the agility
they need to integrate their systems, applications, and partners through XML
Web services. They also provide the flexibility to adapt to changing business
requirements. The .NET Enterprise Servers are:
!
Microsoft Application Center 2000 for deploying and managing highly
available and scalable Web applications.
!
Microsoft BizTalk™ Server 2000 for building XML-based business
processes across applications and organizations.
!
Microsoft Commerce Server 2000 for quickly building scalable e-commerce
solutions.
!
Microsoft Content Management Server 2001 for managing content for
dynamic e-business Web sites.
!
Microsoft Exchange Server 2000 for enabling messaging and collaboration
anytime and anywhere.
!
Microsoft Host Integration Server 2000 for bridging to data and applications
on earlier systems.
!
Microsoft Internet Security and Acceleration Server 2000 for secure, fast
Internet connectivity.
!
Microsoft Mobile Information 2001 Server for enabling application support
by mobile devices like cell phones.
!
Microsoft SharePoint™ Portal Server 2001 for finding, sharing, and
publishing business information.
!
Microsoft SQL Server™ 2000 for storing, retrieving, and analyzing
structured XML data.
Module 1: The Microsoft .NET Platform and XML
5
Standards Used in XML Web Services
Create
Report
Billing Web
Services
Report
Payment
Create
Invoice
Purchasing Web
Services
Create
New Order
Audit
Permissions
Universal
Universaldata
dataformat
format
Publish,
Publish,find,
find,and
anduse
useservices
services
Service
Serviceinteractions
interactions
Ubiquitous
Ubiquitouscommunication
communication
Interface
Interfaceexposition
exposition
Interoperable
Interoperablecode
code
XML
XML
UDDI
UDDI
SOAP
SOAP
Internet
Internet
WSDL
WSDL
C#
C#and
andCLI
CLI
Authenticate
Suspend
Account
Look
Up Orders
Look
Up Inventory
Authentication
Web Services
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
Microsoft is engaged in the standards process for key .NET-enabling
technologies. Standardization of technologies that allow software to
interoperate and exchange data makes solutions involving multiple platforms
possible and benefits end users.
The key .NET-related technology standards are XML, Simple Object Access
Protocol (SOAP), Universal Description, Discovery, and Integration (UDDI),
Web Services Description Language (WSDL), the Common Language
Infrastructure (CLI), and C#.
What is an XML Web
service?
Web sites are primarily designed to exchange information with users.
Sometimes this involves applications outside the Web site, sometimes it does
not. In contrast, XML Web services are designed to allow multiple applications
to interact based on what users want.
One set of XML Web services, known as .NET My Services, is a set of services
oriented around people. .NET My Services is based upon the .NET Passport
user authentication system. With .NET My Services, users receive relevant
information, when they need it, delivered to the devices they are using, and
based on preferences they have established.
The need for standards
We are in an era of standards-based computing. Standards provide the
foundation for the architectural goal of interoperability. The .NET platform is
built on a foundation of industry standards. Applications built on the .NET
platform take advantage of the gains in interoperability that standards provide.
XML: a universal data
format
XML is the universal format for structured data. XML is a set of rules for
designing text formats for data in a way that produces files that are easy to
generate and read, unambiguous, and platform-independent.
Microsoft has been very involved with XML from its conception. XML is
currently managed by the World Wide Web Consortium (W3C), which is the
same formal standards body that owns the Hypertext Markup Language
(HTML) specification.
6
Module 1: The Microsoft .NET Platform and XML
SOAP: an application
linking protocol
SOAP is built on XML. It makes it possible for applications to call each other
in a standard, loosely-coupled way.
If you think of the interactions between XML Web services as a phone call,
XML describes the things that applications say to each other in their
conversations. SOAP describes how they call each other on the phone. How do
you greet the service at the other end? How do you ask for something?
SOAP, like XML, is part of the W3C standards process. It was jointly
submitted by Microsoft and a number of other companies including IBM. Both
XML and SOAP have been publicly endorsed by major software industry
vendors.
UDDI: a directory for
XML Web services
If XML is the conversation, and SOAP describes the rules for how you call
someone, then UDDI is the phone book. UDDI provides a directory of XML
Web services. It allows you to find businesses offering XML Web services.
UDDI is currently a community process with more than 200 participating
companies. The UDDI community intends to submit UDDI to a formal
standards body at some point in the future.
Internet protocols
XML Web services rely on a host of established open Internet standards, such
as HTTP, Simple Mail Transfer Protocol (SMTP), and many others.
WSDL: a language for
exposing XML Web
service interfaces
WSDL provides a standard way to describe what functions are available from a
specific XML Web service and what arguments must be passed to call them.
WSDL, like SOAP, has been submitted to the W3C for standardization.
C# and the CLI
Microsoft has created a new programming language designed for an XML Web
services world, called C#. C# has been submitted for standardization to the
European Computer Manufacturers Association (ECMA), a vendor-neutral
international standards organization committed to driving industry-wide
adoption of information and communications technologies. This standardization
will make it possible for any organization that wishes to implement C#
programming tools on any platform to do so.
Microsoft has also submitted a subset of the .NET Framework, called the CLI,
to ECMA. This will make it possible for other vendors to implement the CLI on
a variety of platforms. Software written by using the basic architectural model
presented by the .NET Framework can be created by using a variety of tools on
a variety of platforms.
Module 1: The Microsoft .NET Platform and XML
7
Practice: Comparing Data Formats
!
In this practice, you are shown two
data formats
!
Discuss which one is easier to work with
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
In this practice, you will compare a set of data formatted in electronic data
interchange (EDI) with the same data formatted in XML and XML Schema
Definitions (XSD) schema. These files are in the
install_folder\Practices\Mod01\EDI2XML folder. You will say why either
format might be easier to use.
Exercise
The following code examples present the same data in two different formats.
Your instructor will lead the class in a discussion of which format is easier for
both computers and humans to use.
The following code is the type of code that you find in an EDI document:
ISA**00*0000000000*01*01*PASSWORDME*01*123456789 987654321
890714*2210*U*000000008*O*P*~
GS*IN*012345678*087654321*900509*2210*000001*X*002040~
ST*801*0001~74832 BEG*940606*1045*940606*~ N1*BT* RAMONA
PUBLISHING~ N3* P.O. BOX 679342~ N4* TX* 77234~ N1*BT* HANSEL
PUBLISHING~ N3* 101 APPLE PIE ST.~ N4* NY* 00103~ N1*BT*
FIVELAKES PUBLISHING~ N3* 79 RIVER DRIVE~ N4* TX* 74564~
PER*AD* J. DOE*TE* 2104355445~ ITD*01*3*2**10~ IT1** 3* CA*
12.75**VC** 6900~ IT1** 12* EA* 2.99**VC** P450~ IT1** 4* EA*
5.99**VC** 1640~ IT1** 1* DZ* 2.45**VC** 1507~ TDS* 100.54~
CAD*M**** CONSOLIDATED TRUCK~ CTT* 4* 20~ SE*21*000001~
GE*1*000001~ IEA*1*000000008~
8
Module 1: The Microsoft .NET Platform and XML
Compare the EDI code with the following code.
<?xml version='1.0' ?>
<invoice>
<organization>
<name> RAMONA PUBLISHING</name>
<street> P.O. BOX 679342</street>
<state> TX, 77234</state>
</organization>
<organization>
<name> HANSEL PUBLISHING</name>
<street> 101 APPLE PIE ST.</street>
<state> NY, 00103</state>
</organization>
<organization>
<name> FIVELAKES PUBLISHING</name>
<street> 79 RIVER DRIVE</street>
<state> TX, 74564 </state>
</organization>
<contact>
<name> J. DOE</name>
2104355445</phone>
</contact>
<order>
<item>
<quantity>3, CA, 12.75,,VC,, 6900</quantity>
</item>
<item>
<quantity>12, EA, 2.99,,VC,, P450</quantity>
</item>
<item>
<quantity>4, EA, 5.99,,VC,, 1640</quantity>
</item>
<item>
<quantity>1, DZ, 2.45,,VC,, 1507</quantity>
</item>
<total_cost>100.54
</total_cost>
</order>
<shipper>
<name>CONSOLIDATED TRUCK</name>
</shipper>
</invoice>
Compare how the data formatted with EDI compares with the XML elements.
Module 1: The Microsoft .NET Platform and XML
9
XML in Applications
!
XML in initialization files
!
XML as import and export format
!
XML in the presentation layer
!
XML as a pervasive system file format
XML Example
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
In addition to being used as a data interchange format in XML Web services,
XML can also help you develop desktop applications.
XML in initialization files
XML has many qualities that make it an ideal format for encoding initialization
files. It is simple, text only, and portable. You can standardize a markup format
in a development organization to make interoperability easier. For example,
Microsoft Office XP uses XML as a format for storing initialization data.
XML as import and
export format
As a universal format for data, XML is an ideal format for importing and
exporting data between applications and across platforms.
XML in the presentation
layer
XML can be presented with sophisticated formatting by using HTML or XSL
style sheets. An XSL style sheet can be used by any application that can link to
an XML processor.
XML as a pervasive
system file format
XML is already an integral part of many Microsoft products. You can verify
this statement if you search for *.xml files on a computer running Windows XP.
XML files are being used for many purposes at the operating system level. In
the operating system environment, XML is used for maintaining core
configuration information.
10
Example
Module 1: The Microsoft .NET Platform and XML
Windows XP uses a file named ipcfg.xml. Here is a part of that file. Can you
tell the purpose of the data that is contained in ipcfg.xml?
<?xml version="1.0"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<actionList>
<action>
<name>SetConnectionType</name>
<argumentList>
<argument>
<name>NewConnectionType</name>
<direction>in</direction>
<relatedStateVariable>ConnectionType</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetConnectionTypeInfo</name>
<argumentList>
<argument>
<name>NewConnectionType</name>
<direction>out</direction>
<relatedStateVariable>ConnectionType</relatedStateVariable>
…
Practice
The use of XML is pervasive in Windows XP and in Office XP. In this practice,
you will open the Windows XP search utility and find files with the .xml
extension. Then, you will open the files to investigate how they are used.
! Find XML system and initialization files
1. Click Start and then click Search.
2. Click All files and folders.
3. In the All or part of the file name box type *.XML
4. Click More advanced options, and then select the Search system folders,
Search hidden files and folders, and Search subfolders check boxes.
5. Click Search.
6. Open a few XML files that are used by the operating system or by
Office XP or other applications. Try to determine how the file is being used.
Important Be sure not to change the contents of any of these files, because you
might cause your computer to operate improperly. When you close the files
after looking at them, do not save any changes.
Module 1: The Microsoft .NET Platform and XML
11
Media: What .NET Delivers
!
Information Anywhere on Any Device
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
This video shows you how data will be made available anywhere on any device.
12
Module 1: The Microsoft .NET Platform and XML
Lesson: XML as a W3C Standard
!
Comparing XML and HTML
!
W3C and the Process of Creating Standards
!
W3C XML Technologies
!
Applications and XML Processors
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
The W3C conceived of XML as a universal format for data. Today, XML
enables developers to easily describe and deliver rich, structured data from any
application in a standard, consistent way. In this lesson you will see the process
that the W3C uses to expand the technological capabilities of XML
technologies. You will also get a first look at XML in comparison to HTML.
XML is dependent upon XML processors. You will also see what XML
processors are installed on your computer.
Lesson objectives
After completing this lesson, you will be able to:
!
Describe the process by which the W3C creates XML standards.
!
Compare XML to HTML.
!
Explain the profusion of W3C XML-based standards.
!
Identify which XML processor is installed on your computer.
Module 1: The Microsoft .NET Platform and XML
13
Comparing XML and HTML
Similarities
! Both consist of text only
!
Both mark content with elements
!
Both use attributes and nested elements
Both are derived from Standard Generalized Markup
Language (SGML)
Differences
! In XML, you create your own element names
!
!
In XML, syntax is strictly enforced
!
HTML presents data; XML describes data
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
One way to understand XML is to compare it to HTML.
How is XML like HTML?
XML and HTML are alike in many ways.
How is XML unlike
HTML?
!
Both XML and HTML consist of text only.
!
Both XML and HTML mark content with tags. In XML, tags are more often
called elements.
!
Both XML and HTML use attributes to mark data.
!
Both XML and HTML allow you to nest one or more elements within one
another.
!
Both XML and HTML are derived from Standard Generalized Markup
Language (SGML).
XML differs from HTML in many ways. With XML, unlike HTML, the
following is true:
!
XML processors strictly enforce XML syntax.
For example, if elements overlap in HTML, the browser can ignore the error
and continue processing the HTML. But if an XML document contains
overlapping elements, the processor stops processing and generates an error
message.
!
In general, in XML you can create your own element names.
!
HTML is about presentation. XML is about describing data.
HTML is concerned with marking text so that it presents well in a browser.
HTML was originally conceived to allow some markup of a document’s
data structure in terms of a hierarchy of headings. However, much of the
structural capabilities of HTML are overshadowed by XML. With XML,
because you are free to invent your own names for elements, you can create
an exact system that marks data in terms of structure and semantics.
14
Example
Module 1: The Microsoft .NET Platform and XML
XML documents must follow rules for identifying document parts and creating
nested element structures. For example, the following HTML code suggests a
combination of bold and italic by overlapping the structures:
<b>This is bold text. <i>This is bold italic text.</b> This is
italic text.</i>
In some HTML browsers, this text appears as follows:
This is bold text. This is bold italic text. This is italic text.
In an XML processor, however, all processing halts as soon as </b> is
encountered, because the XML processor is looking for </i> and does not
accept </b>. To achieve the same formatting in XML, use the following syntax:
<b>This is bold text.</b> <i><b>This is bold italic text.</b>
This is italic text.</i>
Module 1: The Microsoft .NET Platform and XML
15
W3C and the Process of Creating Standards
1. Notes
Research
Research only
only
2. Submissions
3. Activity Proposals
4. Technical Reports
5. Working Draft
Use
Use for
for learning
learning and
and testing
testing
6. Last Call Working Draft
7. Candidate Recommendation
8. Proposed Recommendation
9. W3C Recommendation
Ready
Ready for
for production
production systems
systems
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction
Although the development of standards by W3C follows a well-defined set of
rules, it can move quickly to accommodate the needs of the XML development
community. The XML developer must understand this process and monitor
W3C as it introduces and updates technology specifications.
On the W3C Web site (), there is extensive information on
how to become a member of W3C, how it works, and the specific processes
involved in producing W3C Recommendations.
Important For detailed documentation on the W3C process, go to the World
Wide Web Consortium Process Document at />Process-20010719/. The W3C changes its processes and the document on a
periodic basis.
Membership
Membership is open but governed by a clear set of rules, rights, and obligations.
W3C operates through a discussion and consensus model built around a formal
process. Members may submit submissions and notes, either independently or
through W3C group process.
16
Module 1: The Microsoft .NET Platform and XML
Processes and
documents
W3C members submit notes, submissions, and technical reports. These
documents consist of critiques of existing technologies and suggestions for new
technologies. W3C publishes these documents and uses the discussion that they
generate to guide the revision of existing technologies and to develop entirely
new technologies.
A technology specification goes through several stages. You can check the
progress of a technology as its status changes.
1. Working Draft
2. Last Call Working Draft
3. Candidate Recommendation
4. Proposed Recommendation
5. W3C Recommendation
In theory, you should only use a technology that has attained the status of
Working Draft through Proposed Recommendation to learn from and to test,
but not for production systems. Only when a technology specification reaches
W3C Recommendation should you put it to use in productions systems. In
actual practice, W3C technology specifications are frequently pressed into
service well before they reach Recommendation status.
While a technology specification evolves from Working Draft to W3C
Recommendation, there are many opportunities for revisions, appeals, and
extensions of ideas. After a technology specification reaches W3C
Recommendation status, the process may repeat itself again. W3C designed the
process around the principle that technology evolves while it is put to use in
real settings.
Example
The evolution of XML is a mature example of the results of this process. The
formal process for XML began in 1995.
The newly announced Web Services Description Language (WDSL) is an
example of the process in action (see />