The Java™ Web Services Tutorial
Addison Wesley
978-0-201-76811-4 (ISBN)
- Titel ist leider vergriffen;
keine Neuauflage - Artikel merken
Following in the successful tradition of previous Java Series Tutorials, The JavaaA A TM Web Services Tutorial, Early Access Edition, offers an essential, example-driven resource for every programmer interested in developing and deploying web services and web applications with the Java WSDP. The authors - senior documentation specialists at Sun - offer a concise, all-in-one guide covering the key technologies for building Web services using the Java 2 Platform. They provide practical techniques and examples for working with JavaaA A (tm) Servlets, JSPaA A TM, JSTL and the Java XML Pack to get programmers up to speed. This tutorial is packed with practical examples to reinforce key concepts. Both the tutorial and Sun Microsystems' Web Services Pack are included on the accompanying CD-ROM.
Stephanie Bodoff is a staff writer at Sun Microsystems. In previous positions she worked as a software engineer on distributed computing and telecommunications systems and object-oriented software development methods. Since her conversion to technical writing, Stephanie has documented object-oriented databases, application servers, and enterprise application development methods. Maydene Fisher, a native of San Jose, California, specializes in object-oriented languages. She has experience spanning both coasts of the United States, having documented everything from complex financial models on Wall Street to Java APIs in Silicon Valley. Dale Green is a staff writer with Sun Microsystems, where he documents the J2EE platform. In previous positions he programmed business applications, designed databases, taught technical classes, and documented RDBMS products. In his current position he writes about Enterprise JavaBeans technology and the J2EE SDK. Kim Haase is a staff writer with Sun Microsystems, where she documents the J2EE platform. In previous positions she has documented compilers, debuggers, and floating-point programming. She currently writes about the Java Message Service and J2EE SDK tools.
Foreword.
Preface.
1. Introduction to Web Services.
The Role of XML and the Java Platform.
What Is XML?
What Makes XML Portable?
Overview of the Java APIs for XML.
JAXP.
The SAX API.
The DOM API.
The XSLT API.
JAX-RPC.
Using JAX-RPC.
JAXM.
Getting a Connection.
Creating a Message.
Populating a Message.
Sending a Message.
JAXR.
Using JAXR.
Sample Scenario.
Scenario.
Conclusion.
2. Understanding XML.
Introduction to XML.
What Is XML?
Why Is XML Important?
How Can You Use XML?
XML and Related Specs: Digesting the Alphabet Soup.
Basic Standards.
Schema Standards.
Linking and Presentation Standards.
Knowledge Standards.
Standards That Build on XML.
Summary.
Designing an XML Data Structure.
Saving Yourself Some Work.
Attributes and Elements.
Normalizing Data.
Normalizing DTDs.
3. Getting Started with Tomcat.
Setting Up.
Getting the Example Code.
Checking the Environment Variables.
Creating the Getting Started Application.
The Converter Class.
The Web Client.
Building and Deploying the Getting Started Application Using Ant.
Setting the CLASSPATH.
Creating the Build File for Ant.
Compiling the Source Files.
Deploying the Application.
Running the Getting Started Application.
Starting Tomcat.
Running the Web Client.
Shutting Down Tomcat.
Modifying the Application.
Modifying a Class File.
Modifying the Web Client.
Reloading the Application.
Common Problems and Their Solutions.
Cannot Start the Tomcat Server.
Compilation Errors.
Deployment Errors.
4. Java API for XML Processing.
The JAXP APIs.
An Overview of the Packages.
The Simple API for XML (SAX) APIs.
The SAX Packages.
The Document Object Model (DOM) APIs.
The DOM Packages.
The XML Stylesheet Language for Transformation (XSLT) APIs.
The XSLT Packages.
Compiling and Running the Programs.
Where Do You Go from Here?
5. Simple API for XML.
Writing a Simple XML File.
Creating the File.
Writing the Declaration.
Adding a Comment.
Defining the Root Element.
Adding Nested Elements.
Adding HTML-Style Text.
Adding an Empty Element.
The Finished Product.
Echoing an XML File with the SAX Parser.
Creating the Skeleton.
Importing Classes.
Setting up for I/O.
Implementing the ContentHandler Interface.
Setting up the Parser.
Writing the Output.
Spacing the Output.
Handling Content Events.
Compiling and Running the Program.
Checking the Output.
Identifying the Events.
Compressing the Output.
Inspecting the Output.
Documents and Data.
Adding Additional Event Handlers.
Identifying the Document's Location.
Handling Processing Instructions.
Summary.
Handling Errors with the Nonvalidating Parser.
Substituting and Inserting Text.
Handling Special Characters.
Using an Entity Reference in an XML Document.
Handling Text with XML-Style Syntax.
Handling CDATA and Other Characters.
Creating a Document Type Definition (DTD).
Basic DTD Definitions.
Defining Text and Nested Elements.
Limitations of DTDs.
Special Element Values in the DTD.
Referencing the DTD.
DTD's Effect on the Nonvalidating Parser.
Tracking Ignorable Whitespace.
Cleanup.
Documents and Data.
Empty Elements, Revisited.
Defining Attributes and Entities in the DTD.
Defining Attributes in the DTD.
Defining Entities in the DTD.
Echoing the Entity References.
Additional Useful Entities.
Referencing External Entities.
Echoing the External Entity.
Summarizing Entities.
Referencing Binary Entities.
Using a MIME Data Type.
The Alternative: Using Entity References.
Using the Validating Parser.
Configuring the Factory.
Changing the Environment Variable.
Experimenting with Validation Errors.
Error Handling in the Validating Parser.
Defining Parameter Entities and Conditional Sections.
Creating and Referencing a Parameter Entity.
Conditional Sections.
Parsing the Parameterized DTD.
DTD Warnings.
Handling Lexical Events.
How the LexicalHandler Works.
Working with a LexicalHandler.
Using the DTDHandler and EntityResolver.
The DTDHandler API.
The EntityResolver API.
6. Document Object Model.
Reading XML Data into a DOM.
Creating the Program.
Additional Information.
Looking Ahead.
Displaying a DOM Hierarchy.
Echoing Tree Nodes.
Convert DomEcho to a GUI App.
Create Adapters to Display the DOM in a Jtree.
Finishing Up.
Examining the Structure of a DOM.
Displaying A Simple Tree.
Displaying a More Complex Tree.
Finishing Up.
Constructing a User-Friendly JTree from a DOM.
Compressing the Tree View.
Acting on Tree Selections.
Handling Modifications.
Finishing Up.
Creating and Manipulating a DOM.
Obtaining a DOM from the Factory.
Normalizing the DOM.
Other Operations.
Finishing Up.
Using Namespaces.
Defining a Namespace.
Referencing a Namespace.
Defining a Namespace Prefix.
7. XML Stylesheet Language for Transformations.
Introducing XSLT and XPath.
The XSLT Packages.
How XPath Works.
Summary.
Writing Out a DOM as an XML File.
Reading the XML.
Creating a Transformer.
Writing the XML.
Writing Out a Subtree of the DOM.
Summary.
Generating XML from an Arbitrary Data Structure.
Creating a Simple File.
Creating a Simple Parser.
Modifying the Parser to Generate SAX Events.
Using the Parser as a SAXSource.
Doing the Conversion.
Transforming XML Data with XSLT.
Defining an Ultra-Simple Article Document Type.
Creating a Test Document.
Writing an XSLT Transform.
Processing the Basic Structure Elements.
Writing the Basic Program.
Trimming the Whitespace.
Processing the Remaining Structure Elements.
Process Inline (Content) Elements.
Printing the HTML.
What Else Can XSLT Do?
Concatenating XSLT Transformations with a Filter Chain.
Writing the Program.
Understanding How it Works.
Testing the Program.
Conclusion.
8. Java API for XML Messaging.
Overview of JAXM.
Messages.
Connections.
Messaging Providers.
Running the Samples.
The Sample Programs.
The Provider Administration Tool.
Tutorial.
Client without a Messaging Provider.
Client with a Messaging Provider.
Adding Attachments.
Code Examples.
Request.java.
MyUddiPing.java.
9. Java API for XML-based RPC.
What is JAX-RPC?
A Simple Example: HelloWorld.
HelloWorld at Runtime.
HelloWorld Files.
Overview of Steps.
Setting Up.
Coding the Service Definition Interface and Implementation Class.
Compiling the Service Definition Code.
Creating the Configuration File.
Generating the Stubs and Ties.
Creating the Deployment Descriptor.
Packaging the Service Definition.
Deploying the Service Definition.
Coding the Client.
Compiling the Client Code.
Running the Client.
The Dynamic Invocation Interface.
When to Use DII.
A DII Client Example.
10. Java API for XML Registries.
Overview of JAXR.
What is a Registry?
What Is JAXR?
JAXR Architecture.
Implementing a JAXR Client.
Establishing a Connection.
Querying a Registry.
Managing Registry Data.
Running the Client Examples.
Using the Registry Browser.
Querying a Registry.
Managing Registry Data.
11. The Java WSDP Registry Server.
Setting Up the Registry Server.
Using the JAXR Registry Browser with the Registry Server.
Adding Organizations.
Querying the Registry.
Using the Command Line Client Scripts with the Registry Server.
Using the JAXR API to Access the Registry Server.
Using the Indri Tool to Access the Registry Server Database.
12. Web Applications.
Web Application Life Cycle.
Web Application Archives,
Creating a WAR File.
Web Application Deployment Descriptors.
Prolog.
Context Parameters.
Filter Mappings.
Event Listeners.
Alias Paths.
Error Mappings.
References to Environment Entries, Resource Environment Entries, or Resources.
Deploying Web Applications.
Specifying the Web Application Context.
Example.
Running Web Applications.
Updating Web Applications.
Internationalizing and Localizing Web Applications.
Accessing Databases from Web Applications.
The Examples.
Downloading and Starting the Database Server.
Populating the Database.
Configuring the Web Application to Use the Database.
Configuring the Server to Recognize the Database.
13. Java Servlet Technology.
What is a Servlet?
The Example Servlets.
Troubleshooting.
Servlet Life Cycle.
Handling Servlet Life Cycle Events.
Handling Errors.
Sharing Information.
Using Scope Objects.
Controlling Concurrent Access to Shared Resources.
Accessing Databases.
Initializing a Servlet.
Writing Service Methods.
Getting Information From Requests.
Constructing Responses.
Filtering Requests and Response.
Programming Filters.
Programming Customized Requests and Responses.
Specifying Filter Mappings.
Invoking Other Web Resources.
Including Other Resources in the Response.
Transferring Control to Another Web Component.
Accessing the Web Context.
Maintaining Client State.
Accessing a Session.
Associating Attributes with a Session.
Session Management.
Session Tracking.
Finalizing a Servlet.
Tracking Service Requests.
Notifying Methods to Shut Down.
Creating Polite Long-Running Methods.
14. JavaServer Pages Technology.
What is a JSP Page?
The Example JSP Pages.
The Life Cycle of a JSP Page.
Translation and Compilation.
Execution.
Initializing and Finalizing a JSP Page.
Creating Static Content.
Creating Dynamic Content.
Using Objects Within JSP Pages.
JSP Scripting Elements.
Including Content in a JSP Page.
Transferring Control to Another Web Component.
Param Element.
Including an Applet.
Extending the JSP Language.
15. JavaBeans Components in JSP Pages.
JavaBeans Component Design Conventions.
Why Use a JavaBeans Component?
Creating and Using a JavaBeans Component.
Setting JavaBeans Component Properties.
Retrieving JavaBeans Component Properties.
16. Custom Tags in JSP Pages.
What is a Custom Tag?
The Example JSP Pages.
Using Tags.
Declaring Tag Libraries.
Making the Tag Library Implementation Available.
Types of Tags.
Defining Tags.
Tag Handlers.
Tag Library Descriptors.
Simple Tags.
Tags with Attributes.
Tags with Bodies.
Tags That Define Scripting Variables.
Cooperating Tags.
Examples.
An Iteration Tag.
A Template Tag Library.
How Is a Tag Handler Invoked?
17. JavaServer Pages Standard Tag Library.
The Example JSP Pages.
Using JSTL.
Expression Language Support.
Twin Libraries.
Specifying an Expression Language Evaluator.
Simplest Possible Expression Language (SPEL).
Tag Collaboration.
Core Tags.
Expression Tags.
Flow Control Tags.
Import Tags.
XML Tags.
Core Tags.
Flow Control Tags.
Transformation Tags.
Internationalization Tags.
Messaging Tags.
Formatting Tags.
SQL Tags.
Query Tag Result-Related Interfaces.
18. The xrpcc Tool.
Syntax.
Configuration File.
Starting with RMI Interfaces.
Starting with a WSDL Document.
Specifying the Type Mapping.
19. HTTP Overview.
HTTP Requests.
HTTP Responses.
Appendix: Java Encoding Schemes.
About the Authors.
Index. 0201768119T03262002
Erscheint lt. Verlag | 7.6.2002 |
---|---|
Verlagsort | Boston |
Sprache | englisch |
Gewicht | 1106 g |
Themenwelt | Informatik ► Programmiersprachen / -werkzeuge ► Java |
Mathematik / Informatik ► Informatik ► Web / Internet | |
ISBN-10 | 0-201-76811-9 / 0201768119 |
ISBN-13 | 978-0-201-76811-4 / 9780201768114 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich