Monday, December 20, 2010

Developing .NET Web Services with XML













Contents
ix
Foreword xvii
Chapter 1 What Are Web Services? 1
Introduction 2
Understanding Web Services 3
Communication between Servers 8
.asmx Files 10
WSDL 15
Using XML in Web Services 16
An Overview of the System.Web.Services
Namespace 17
The System.Web.Services.Description
Namespace 17
The System.Web.Services.Discovery
Namespace 17
The System.Web.Services.Protocols
Namespace 18
Type Marshalling 19
Using DataSets 21
Summary 24
Solutions Fast Track 24
Frequently Asked Questions 26
Chapter 2 Introduction to the
Microsoft .NET Framework 29
Introduction 30
Obtaining the .NET Framework SDK 31
System Requirements 31
Hardware 32
Operating System 33
Additional Installation Information 33
Locations for Downloading 34
Installing the .NET Framework 34
Common Language Runtime 36
Major Responsibilities of the CLR 36
Safety and Security Checks 37
Class Loading 37
Object Lifetime Management 37
Just In Time (JIT) Compilation 38
Cross-Language Interoperability 38
Structured Exception Handling 39
Assemblies 39
Metadata 40
Enhanced Deployment and Versioning
Support 41
Managed versus Unmanaged Code 41
Interoperability with Unmanaged Code 42
Namespaces 42
Developing Applications with the
.NET Framework 43
Development Platforms for .NET 43
Language Choice 45
Using the Compilers 45
Tools 46
Base Class Libraries 49
Components in the .NET Framework 55
ASP.NET 55
ADO.NET 56
VB.NET 57
C# 59
Windows Forms 60
Web Services 61
Summary 62
Solutions Fast Track 63
Frequently Asked Questions 65
Chapter 3 XML Fundamentals 67
Introduction 68
An Overview of XML 68
What Does an XML Document Look Like? 69
Creating an XML Document 70
Creating an XML Document
in VS.NET XML Designer 71
Components of an XML Document 72
Well-Formed XML Documents 75
Schema and Valid XML Documents 76
Structure of an XML Document 80
Processing XML Documents Using .NET 81
Reading and Writing XML Documents 82
Storing and Processing XML Documents 83
Reading and Parsing Using the
XmlTextReaderClass 84
Parsing an XML Document 85
Navigating through an XML
Document to Retrieve Data 87
Writing an XML Document
Using the XmlTextWriterClass 90
Generating an XML Document
Using XmlTextWriter 90
Exploring the XML Document Object Model 93
Navigating through an XmlDocument Object 94
Parsing an XML Document
Using the XmlDocument Object 95
Using the XmlDataDocument Class 98
Loading an XmlDocument and
Retrieving the Values of Certain Nodes 99
Using the Relational View of
an XmlDataDocument Object 100
Viewing Multiple Tables of
a XmlDataDocument Object 103
Querying XML Data Using XPathDocument
and XPathNavigator 107
Using XPathDocument and
XPathNavigator Objects 110
Using XPathDocument and XPathNavigator
Objects for Document Navigation 112
Transforming an XML Document Using XSLT 115
Transforming an XML Document to
an HTML Document 116
Transforming an XML Document
into Another XML Document 119
Working with XML and Databases 124
Creating an XML Document
from a Database Query 125
Reading an XML Document into a DataSet 127
Summary 129
Solutions Fast Track 129
Frequently Asked Questions 133
Chapter 4 Information Exchange Using
the Simple Object Access Protocol (SOAP) 135
Introduction 136
The Case for Web Services 136
The Role of SOAP 137
Why SOAP? 138
Why Web Services? 139
Wiring Up Distributed Objects—
The SOAP Protocol 139
Creating Your Very First Web Service 139
Running Your Very First Web Service 146
Working with Web Services 159
Passing Complex Data Types 159
Error Handling 162
Malformed SOAP Request 163
Wrong Argument Types 165
Exceptions in Server Code 165
Writing a SOAP Client Application 167
Passing Objects 174
Passing Relational Data (DataSets) 179
Passing XML Documents 182
SOAP Headers 186
Advanced Web Services 187
Maintaining State 187
State Information in the URL
(URL Mangling) 189
State Information in the Http
Header (Cookies) 191
State Information in the Http
Body (SOAP Header) 194
Security 202
Summary 204
Solutions Fast Track 205
Frequently Asked Questions 207
Chapter 5 WSDL and UDDI 209
Introduction 210
Web Service Standards 211
Describing Web Services—WSDL 211
Discovering Web Services—DISCO 217
Publishing Web Services—UDDI 219
Working with UDDI 220
Summary 228
Solutions Fast Track 229
Frequently Asked Questions 231
Chapter 6 Building an ASP.NET/ADO.NET
Shopping Cart with Web Services 233
Introduction 234
Setting Up the Database 234
Setting Up the Table Books 237
Setting Up the Table Categories 237
Setting Up the Table Customer 237
Setting Up the Table Orders 238
Setting Up the Table BookOrders 238
Creating an Access Database 238
SQL Server Database 242
Creating the Stored Procedures 244
Creating the Web Services 250
Overview of the Book Shop Web Services 250
Creating the Data Connection 252
Creating a Web Service 253
Testing a Web Service in ASP.NET 259
Using WSDL Web References 263
Building the Site 264
Site Administration 266
Creating the Administration Login
(adminLogin.aspx) 266
Creating the Administrator
Page (adminPage.aspx) 268
Retrieving the Data: Creating the
getBooks.AllBooksWeb Method 268
Displaying the Data: Binding
a DataGrid to the DataSet 272
Adding New Books to the Database:
Creating the allBooks.addItem
Web Method 272
Deleting Books: Deleting from
the DataGrid and the Database 272
Updating Book Details: Updating
the DataGrid and the Database 273
Creating the addBook Page (addBook.aspx) 274
Customer Administration 275
Creating the Customer Admin Section 275
Creating the loginCustomer Page 275
Creating the updateCustomerInfo Page 276
Creating an ADOCatalog 278
Creating the BookCatalog Class 279
Creating the CreateSummaryTable
Method 280
Creating the InitCatalog Method 281
Creating the Catalog Method 281
Creating the catalogItemDetails,
catalogRange, and catalogByCategory
Methods 281
Creating the catalogRangeByCategory
Method 282
Building an XMLCart 284
Creating the User Interface 287
Creating the start.aspx Page 288
Rendering the Catalog 289
Rendering the Cart 290
Creating the Code 290
Summary 293
Solutions Fast Track 293
Frequently Asked Questions 297
Chapter 7 Building a SQLXML
Web Service Application 299
Introduction 300
SQLXML Web Services 301
Developing the TimeTrack Application 301
Creating the Database 302
Creating the Stored Procedures 303
Creating a SQL Server Virtual Directory 305
Enabling Stored Procedures for Soap 310
Creating a Client Application in ASP.NET 313
Consuming the Web Services 317
Summary 333
Solutions Fast Track 334
Frequently Asked Questions 335
Chapter 8 Building a Jokes Web Service 337
Introduction 338
Motivation and Requirements for the Jokes
Web Service 338
Functional Application Design 340
Defining Public Methods 340
Defining the Database Schema 341
Defining the Web Service Architecture 342
Security Considerations 344
State Management 345
Error Handling 345
Implementing the Jokes Data Repository 345
Installing the Database 346
Creating the Stored Procedures 348
Implementing the Jokes Middle Tier 361
Setting Up the Visual Studio Project 361
Developing the Error Handler 366
Developing the Database Access Component 369
Developing the User Administration Service 371
Adding New Users 371
Checking Existing User Information 376
Adding Moderators 379
Creating the Public Web Methods—Users 381
Error Handling for the Public Web
Methods 384
Creating The Public Web Methods—
Administrators 386
Testing the Public Web Methods 389
Developing the Jokes Service 390
Best Practices for Returning Highly
Structured Data 390
Setting Up Internal Methods to
Wrap the Stored Procedure Calls 393
Setting Up Internal Methods
to Manage Jokes and Ratings 399
Setting Up Internal Methods to
Return Jokes 407
Creating the Public Web Methods 413
Creating a Client Application 423
Some Ideas to Improve the Jokes
Web Service 439
Summary 440
Solutions Fast Track 441
Frequently Asked Questions 443
Index 445

Another .NET Books
Another Web Programming Books
Download

No comments:

Post a Comment

Related Posts with Thumbnails

Put Your Ads Here!