The Java Web Services Tutorial

Table P-1 The Java Tutorial are particularly relevant: run the examples … This tutorial documents the Java WSDP EA2. To build, deploy and implement the Java EE 5 platform ….

More PDF Content

The Java Web Services Tutorial

  • Chapter 1: Introduction to Web Services … 1
  • The Role of XML and the Java™ Platform 2
  • What Is XML? 4
  • What Makes XML Portable? 5
  • Overview of the Java APIs for XML 6
  • JAXP 7
  • The SAX API 8
  • The DOM API 10
  • The XSLT API 13
  • JAX-RPC 16
  • Overview of JAX-RPC 16
  • Using JAX-RPC 18
  • Creating a Web Service 19
  • Coding a Client 21
  • Invoking a Remote Method 22
  • JAXM 22
  • Getting a Connection 24
  • Creating a Message 25
  • Populating a Message 26
  • Sending a Message 28
  • JAXR 29
  • Using JAXR 29
  • Sample Scenario 32
  • Scenario 32
  • Conclusion 33
  • Chapter 2: Understanding XML…35
  • Introduction to XML 36
  • What Is XML? 36
  • Why Is XML Important? 41
  • How Can You Use XML? 43
  • XML and Related Specs: Digesting the Alphabet Soup 46
  • Basic Standards 47
  • Schema Standards 49
  • Linking and Presentation Standards 52
  • Knowledge Standards 53
  • Standards That Build on XML 54
  • Summary 56
  • Designing an XML Data Structure 57
  • Saving Yourself Some Work 57
  • Attributes and Elements 57
  • Normalizing Data 60
  • Normalizing DTDs 61
  • Chapter 3: Getting Started With Tomcat …63
  • Setting Up 64
  • Getting the Example Code 64
  • Checking the Environment Variables 66
  • Creating the Build Properties File 66
  • Creating the Getting Started Application 67
  • The ConverterBean Component 67
  • The Web Client 69
  • Building the Getting Started Application Using Ant 71
  • Creating the Build and Deploy File for Ant 71
  • Compiling the Source Files 73
  • Deploying the Application 74
  • Starting Tomcat 74
  • Installing the Application using Ant 74
  • Deploying the Application Using the Application Deployment Tool 75
  • Running the Getting Started Application 77
  • Running the Web Client 77
  • Shutting Down Tomcat 78
  • Using admintool 79
  • Adding Roles Using admintool 79
  • Adding Users Using admintool 80
  • Modifying the Application 80
  • Modifying a Class File 81
  • Modifying the Web Client 81
  • Common Problems and Their Solutions 81
  • Compilation Errors 82
  • Deployment Errors 83
  • Chapter 4: Java API for XML Processing … 85
  • The JAXP APIs 86
  • An Overview of the Packages 86
  • The Simple API for XML (SAX) APIs 87
  • The SAX Packages 90
  • The Document Object Model (DOM) APIs 90
  • The DOM Packages 92
  • The XML Stylesheet Language for Transformation (XSLT) APIs 93
  • The XSLT Packages 94
  • Compiling and Running the Programs 94
  • Where Do You Go from Here? 94
  • Chapter 5: Simple API for XML … 97
  • Writing a Simple XML File 98
  • Creating the File 99
  • Writing the Declaration 99
  • Adding a Comment 99
  • Adding Nested Elements 101
  • Adding HTML-Style Text 102
  • Adding an Empty Element 102
  • The Finished Product 103
  • Echoing an XML File with the SAX Parser 104
  • Creating the Skeleton 104
  • Importing Classes 105
  • Setting up for I/O 105
  • Implementing the ContentHandler Interface 106
  • Setting up the Parser 107
  • Writing the Output 108
  • Spacing the Output 109
  • Handling Content Events 109
  • Compiling and Running the Program 112
  • Checking the Output 113
  • Identifying the Events 114
  • Compressing the Output 116
  • Inspecting the Output 117
  • Documents and Data 118
  • Adding Additional Event Handlers 119
  • Identifying the Document’s Location 119
  • Handling Processing Instructions 121
  • Summary 122
  • Handling Errors with the Nonvalidating Parser 123
  • Substituting and Inserting Text 132
  • Handling Special Characters 133
  • Using an Entity Reference in an XML Document 134
  • Handling Text with XML-Style Syntax 135
  • Handling CDATA and Other Characters 136
  • Creating a Document Type Definition (DTD) 137
  • Basic DTD Definitions 137
  • Defining Text and Nested Elements 139
  • Limitations of DTDs 139
  • Special Element Values in the DTD 140
  • Referencing the DTD 141
  • DTD’s Effect on the Nonvalidating Parser 142
  • Tracking Ignorable Whitespace 143
  • Cleanup 145
  • Documents and Data 145
  • Empty Elements, Revisited 145
  • Defining Attributes and Entities in the DTD 146
  • Defining Attributes in the DTD 146
  • Defining Entities in the DTD 148
  • Echoing the Entity References 150
  • Additional Useful Entities 151
  • Referencing External Entities 151
  • Echoing the External Entity 152
  • Summarizing Entities 153
  • Referencing Binary Entities 153
  • Using a MIME Data Type 153
  • The Alternative: Using Entity References 155
  • Using the Validating Parser 155
  • Configuring the Factory 156
  • Changing the Environment Variable 156
  • Experimenting with Validation Errors 157
  • Error Handling in the Validating Parser 159
  • Defining Parameter Entities and Conditional Sections 159
  • Creating and Referencing a Parameter Entity 159
  • Conditional Sections 161
  • Parsing the Parameterized DTD 163
  • DTD Warnings 165
  • Handling Lexical Events 166
  • How the LexicalHandler Works 167
  • Working with a LexicalHandler 167
  • Using the DTDHandler and EntityResolver 173
  • The DTDHandler API 173
  • The EntityResolver API 175
  • Chapter 6: Document Object Model … 177
  • Reading XML Data into a DOM 178
  • Creating the Program 178
  • Additional Information 183
  • Looking Ahead 185
  • Displaying a DOM Hierarchy 185
  • Echoing Tree Nodes 185
  • Convert DomEcho to a GUI App 185
  • Create Adapters to Display the DOM in a JTree 191
  • Finishing Up 201
  • Examining the Structure of a DOM 201
  • Displaying A Simple Tree 202
  • Displaying a More Complex Tree 204
  • Finishing Up 208
  • Constructing a User-Friendly JTree from a DOM 209
  • Compressing the Tree View 209
  • Acting on Tree Selections 214
  • Handling Modifications 223
  • Finishing Up 223
  • Creating and Manipulating a DOM 223
  • Obtaining a DOM from the Factory 223
  • Normalizing the DOM 227
  • Other Operations 229
  • Finishing Up 229
  • Using Namespaces 230
  • Defining a Namespace 230
  • Referencing a Namespace 231
  • Defining a Namespace Prefix 232
  • Chapter 7: XML Stylesheet Language for Transformations…235
  • Introducing XSLT and XPath 236
  • The XSLT Packages 236
  • How XPath Works 237
  • Summary 246
  • Writing Out a DOM as an XML File 247
  • Reading the XML 247
  • Creating a Transformer 249
  • Writing the XML 251
  • Writing Out a Subtree of the DOM 252
  • Summary 253
  • Generating XML from an Arbitrary Data Structure 253
  • Creating a Simple File 254
  • Creating a Simple Parser 256
  • Modifying the Parser to Generate SAX Events 259
  • Using the Parser as a SAXSource 265
  • Doing the Conversion 267
  • Transforming XML Data with XSLT 268
  • Defining an Ultra-Simple article Document Type 268
  • Creating a Test Document 270
  • Writing an XSLT Transform 271
  • Processing the Basic Structure Elements 272
  • Writing the Basic Program 276
  • Trimming the Whitespace 278
  • Processing the Remaining Structure Elements 281
  • Process Inline (Content) Elements 286
  • Printing the HTML 290
  • What Else Can XSLT Do? 290
  • Concatenating XSLT Transformations with a Filter Chain 293
  • Writing the Program 293
  • Understanding How it Works 296
  • Testing the Program 298
  • Conclusion 300
  • Chapter 8: Java API for XML Messaging …301
  • Overview of JAXM 302
  • Messages 302
  • Connections 305
  • Messaging Providers 307
  • Running the Samples 310
  • The Sample Programs 310
  • The Provider Administration Tool 312
  • Tutorial 313
  • Client without a Messaging Provider 313
  • Client with a Messaging Provider 320
  • Adding Attachments 326
  • Code Examples 329
  • Request.java 329
  • MyUddiPing.java 331
  • Chapter 9: Java API for
  • XML-based RPC343
  • What Is JAX-RPC? 344
  • A Simple Example: HelloWorld 345
  • HelloWorld at Runtime 345
  • HelloWorld Files 347
  • Setting Up 347
  • Building and Installing the Service 349
  • Building and Running the Client 354
  • Iterative Development 357
  • Optional: Packaging the Service 358
  • Types Supported By JAX-RPC 359
  • J2SE SDK Classes 359
  • Primitives 360
  • Arrays 360
  • Application Classes 362
  • JavaBeans Components 362
  • The Dynamic Invocation Interface 365
  • When to Use DII 365
  • A DII Client Example 366
  • Chapter 10: Java API for XML Registries … 369
  • Overview of JAXR 370
  • What is a Registry? 370
  • What Is JAXR? 370
  • JAXR Architecture 371
  • Implementing a JAXR Client 372
  • Establishing a Connection 373
  • Querying a Registry 375
  • Managing Registry Data 379
  • Running the Client Examples 384
  • Using the Registry Browser 389
  • Starting the Browser 390
  • Querying a Registry 391
  • Managing Registry Data 392
  • Stopping the Browser 395
  • Chapter 11: The Java WSDP Registry Server …397
  • Setting Up the Registry Server 398
  • Using the JAXR Registry Browser with the Registry Server 399
  • Adding and Deleting Organizations 400
  • Querying the Registry 400
  • Using the JAXR API to Access the Registry Server 400
  • Using the Command Line Client Script with the Registry Server 402
  • Using the Indri Tool to Access the Registry Server Database 405
  • Adding New Users to the Registry 408
  • Chapter 12: Web Applications …411
  • Web Application Life Cycle 413
  • Web Application Archives 415
  • WAR Directory Structure 415
  • Tutorial Example Directory Structure 416
  • Creating a WAR 416
  • Configuring Web Applications 418
  • Prolog 418
  • Alias Paths 419
  • Context Parameters 420
  • Event Listeners 420
  • Filter Mappings 421
  • Error Mappings 422
  • References to Environment Entries, Resource Environment Entries, or
  • Resources 423
  • Installing Web Applications 423
  • Deploying Web Applications 425
  • Listing Installed and Deployed Web Applications 426
  • Running Web Applications 427
  • Updating Web Applications 427
  • Reloading Web Applications 428
  • Redeploying Web Applications 429
  • Removing Web Applications 429
  • Undeploying Web Applications 430
  • Internationalizing and Localizing Web Applications 430
  • Accessing Databases from Web Applications 432
  • The Examples 432
  • Installing and Starting the Database Server 433
  • Populating the Database 433
  • Configuring the Web Application to Reference a Database 434
  • Configuring Tomcat to Map the JNDI Name to a Database 435
  • Chapter 13: Java Servlet Technology … 437
  • What is a Servlet? 438
  • The Example Servlets 439
  • Troubleshooting 440
  • Servlet Life Cycle 441
  • Handling Servlet Life Cycle Events 441
  • Handling Errors 443
  • Sharing Information 444
  • Using Scope Objects 444
  • Controlling Concurrent Access to Shared Resources 446
  • Accessing Databases 447
  • Initializing a Servlet 448
  • Writing Service Methods 449
  • Getting Information from Requests 450
  • Constructing Responses 452
  • Filtering Requests and Responses 454
  • Programming Filters 455
  • Programming Customized Requests and Responses 457
  • Specifying Filter Mappings 459
  • Invoking Other Web Resources 461
  • Including Other Resources in the Response 462
  • Transferring Control to Another Web Component 464
  • Accessing the Web Context 465
  • Maintaining Client State 466
  • Accessing a Session 466
  • Associating Attributes with a Session 466
  • Session Management 467
  • Session Tracking 468
  • Finalizing a Servlet 469
  • Tracking Service Requests 469
  • Notifying Methods to Shut Down 470
  • Creating Polite Long-Running Methods 471
  • Chapter 14: JavaServer Pages Technology …473
  • What Is a JSP Page? 474
  • The Example JSP Pages 476
  • The Life Cycle of a JSP Page 478
  • Translation and Compilation 479
  • Execution 480
  • Initializing and Finalizing a JSP Page 481
  • Creating Static Content 482
  • Creating Dynamic Content 482
  • Using Objects within JSP Pages 482
  • JSP Scripting Elements 485
  • Including Content in a JSP Page 488
  • Transferring Control to Another Web Component 490
  • jsp:param Element 490
  • Including an Applet 490
  • Extending the JSP Language 493
  • Chapter 15: JavaBeans Components in JSP Pages …495
  • JavaBeans Component Design Conventions 496
  • Why Use a JavaBeans Component? 497
  • Creating and Using a JavaBeans Component 498
  • Setting JavaBeans Component Properties 499
  • Retrieving JavaBeans Component Properties 501
  • Chapter 16: Custom Tags in JSP Pages …505
  • What Is a Custom Tag? 506
  • The Example JSP Pages 507
  • Using Tags 509
  • Declaring Tag Libraries 509
  • Making the Tag Library Implementation Available 510
  • Types of Tags 511
  • Defining Tags 513
  • Tag Handlers 514
  • Tag Library Descriptors 515
  • Simple Tags 518
  • CONTENTS xv
  • Tags with Attributes 519
  • Tags with Bodies 521
  • Tags That Define Scripting Variables 524
  • Cooperating Tags 528
  • Examples 530
  • An Iteration Tag 530
  • A Template Tag Library 534
  • How Is a Tag Handler Invoked? 539
  • Chapter 17: JavaServer Pages Standard Tag Library … 541
  • The Example JSP Pages 542
  • Using JSTL 543
  • Expression Language Support 545
  • Twin Libraries 546
  • JSTL Expression Language 547
  • Tag Collaboration 549
  • Core Tags 550
  • Expression Tags 550
  • Flow Control Tags 552
  • URL Tags 553
  • XML Tags 554
  • Core Tags 555
  • Flow Control Tags 556
  • Transformation Tags 556
  • Internationalization Tags 556
  • Setting the Locale 557
  • Messaging Tags 557
  • Formatting Tags 558
  • SQL Tags 559
  • query Tag Result-Related Interfaces 560
  • Chapter 18: Web Application Security … 563
  • Overview 564
  • Users, Groups, and Roles 565
  • Security Roles 565
  • Managing Groups, Roles, and Users 566
  • Mapping Application Roles to Realm Roles 571
  • Web-Tier Security 572
  • Protecting Web Resources 572
  • Controlling Access to Web Resources 572
  • Authenticating Users of Web Resources 574
  • Using Programmatic Security in the Web Tier 576
  • Unprotected Web Resources 577
  • EIS-Tier Security 578
  • Configuring Sign-On 578
  • Container-Managed Sign-On 579
  • Component-Managed Sign-On 579
  • Setting Up a Server Certificate 579
  • For more information 581
  • Appendix A: The xrpcc Tool …583
  • Syntax 584
  • Configuration File 585
  • Starting With RMI Interfaces 585
  • Starting With a WSDL Document 587
  • Specifying the Type Mapping 588
  • Appendix B: HTTP Overview …589
  • HTTP Requests 590
  • HTTP Responses 590
  • Appendix C: Java Encoding Schemes …591
Download The Java Web Services Tutorial pdf from helpme.engr.scu.edu, 616 pages, 3064.5KB.
Related Books

Leave a Reply