Contents
The Sun ONE Developer Platform is an integrated toolkit for building Web services and applications that use Web services. But what's a Web service? Why is it important? How does a Web service "work"? And how does the Sun ONE Developer Platform fit into this Web services picture? This article answers these questions. Specifically, it introduces you to the "what" and "why" of Web services. It describes some of the important technologies that drive Web services. And it highlights the Web services-related features of the Sun ONE Developer Platform. An Introduction to Web Services
Many people see Web services as the next big thing on the Internet. It's certainly a potentially big thing for business-to-business (B2B) collaboration. It used to be that if two companies wanted to exchange information or share application systems, it was often a long and painful process. For example, aligning systems so that a company's inventory system communicated intelligently with a new supplier's production system was typically a real headache involving a lot of negotiation regarding how requests were communicated, how information was represented, and so on. Trying to collaborate between multiple companies usually compounded these headaches.
The Web services approach greatly simplifies B2B collaboration and provides a new model for the way businesses share their data and systems. In the Web services model, the Internet is leveraged to present a wide array of services, that is, self-contained modules of business function, that can be discovered and used on demand. In other words, a Web service is a modular piece of code on the Internet that provides one or more business functions, and that can be discovered and used on demand. The Web services approach typically involves these actions:
Here are some important things to consider about this approach: It's based on standards The entire Web services approach is based on a set of standard protocols and technologies, so that all participating components understand how to communicate. For example, service discovery in a UDDI registry, as well as requests for the service, use a standard messaging protocol called SOAP. Service definitions follow a Web service description standard called WSDL. And the transactions that involve the exchange of business profiles follow ebXML Messaging standards. The bottom line is that companies no longer have to work out special, proprietary agreements regarding how to communicate requests between their systems, and what the communicated information means. It offers advantages to service providers and clients In the big picture, the Web services model offers advantages to Web service providers and the clients that use the services. Web service providers can use the Internet to market their services to a potentially huge set of possible clients. For clients, it can mean quicker and more flexible application development. Instead of creating large applications that include all necessary logic and data, developers can create smaller applications that access needed functions through Web services. For example, instead of including credit card transaction processing functions in an online retail application, an application can access a Web service that provides those functions. Clients can search for registered services that meet their requirements, select the best one, and use it. It doesn't matter where the Web service is located on the Internet -- as long as the Web service is registered, it's available to clients. In other words, the entire World Wide Web is potentially available to satisfy the service requirements of a client. In addition, a Web service can locate and use other Web services. For example, the credit card transaction Web service can access a Web service that tracks credit history. Technologies and tools for Web service providers and clients are available Recently, Sun Microsystems made available the Sun ONE Developer Platform as part of the Sun ONE Starter Kit. The Sun ONE Developer Platform is a sophisticated development environment based on Java technology and Java 2 Platform, Enterprise Edition (J2EE). It contains tools and servers that can be used to build and test Java-based Web services, and Java applications that access Web services. Let's look at some of the fundamental technologies that drive the Web services model. Then let's examine how the Sun ONE Developer Platform supports these technologies in helping developers build Web services and applications that use Web services. Web Services Technologies
One of the things that makes the Web services model so attractive is that it's built on standard technologies, especially Extensible Markup Language (XML) technologies, that have wide industry acceptance. These technologies make for an "open" environment, ensuring that a Web service can be located and used, no matter where it is, what platform it runs on, or who developed it. This section describes XML and the following XML technologies that are pertinent to Web services:
XML
XML is emerging as the standard for exchanging data on the Internet. There are a number of reasons for this, some of which are: XML is relatively easy to learn, especially for people who know HTML In fact, XML and Hypertext Markup Language (HTML) have the same ancestry: Standard Generalized Markup Language (SGML). SGML is an international standard for defining the structure of electronic documents. These include Web-based and non-Web-based documents. SGML is functionally rich but complex. HTML is a small, simple application of SGML that defines the structure of the type of document you typically see on the Web -- that is, one with paragraphs, lists, tables, graphics and so on. XML is a more ambitious application of SGML. It allows you to define your own type of documents (to learn more about that, see XML is extensible). For people who know HTML, a language whose use is pervasive across the Web, learning XML tends not to be a major obstacle. Like HTML, XML involves the use of tags that "mark up" the contents of a text file, (notice that the "M" in HTML, XML, and SGML stands for Markup) however the objective of the markup differs. HTML tags are designed for presentation. They instruct an application that can interpret the tags, such as a Web browser, how to display information. For example, the following HTML markup instructs the interpreting application to:
<h4>This is a heading</h4> <p>This is a paragraph. Here's the second line of the paragraph. Here's the end of the paragraph. </p> <ol> <li>The first item</li> <li>The last item</li> </ol> And here's the displayed result. (Note that the box around the output is simply to set it off from the text in this article. The previous HTML tags do not create the box, although you can display a box like this using HTML tags.)
XML describes the content of a document An XML tag identifies information in a document, and also identifies the structure of the information. Applications capable of interpreting these tags can then process the information according to the meaning of the information and its organization.
For example, the following XML markup identifies some information.
The information is identified as <bookshelf> <book> <title>My Life and Times</title> <author>Felix Harrison</author> <price>39.95</price> </book> <book> <title>Travel Tips for the Frugal</title> <author>Juan Arellaga</author> <price>25.00</price> </book> </bookshelf>
Although tags such as XML documents have a well-formed structure
Notice that in the previous example, each XML tag has an ending tag. For example,
<emptytag></emptytag> You can code it like this: <emptytag/> These requirements are part of set of requirements that must be met to make an XML document "well-formed". To be valid, an XML document must be well-formed. Because valid XML documents must be well-formed, it makes it easier to create programs that process XML documents. The structure within an XML tag is consistent
An important requirement for effective data interchange, that is, in addition
to having a consistently understood meaning associated with an XML tag,
is the consistent structure of an XML document. Structural consistency can mean that
an XML document is well-formed. However, it can
also mean that the structure inside of an XML tag is consistent. For example,
it might mean that an application can rely on the fact
that any time a XML is extensible A schema specifies the "grammar" for an XML document. In other words, it specifies what tags are allowed in the document, the structure of those tags, and other rules about the tags, such as what type of data is expected in a tag (or no data if it's an empty tag). A schema is typically specified in a Document Type Definition (DTD). A DTD however is optional. There are other mechanisms to specify a schema. Additionally, you don't have to specify any grammar at all. In that case, the XML document is relatively unconstrained. It can include any tags -- you can even define your own tags. In this way, XML (unlike HTML) allows you to define your own type of document. However, whatever type of document you define, it still needs to be well-formed. This ability to define your own tags means that XML is extensible (remember that the X in XML stands for extensible).
A DTD specification for the
<!ELEMENT bookshelf(book)+> <!ELEMENT book(title, author, price)> <!ELEMENT title(#PCDATA)+> <!ELEMENT author(#PCDATA)+> <!ELEMENT price(#PCDATA)+>
The specification says that there is an "element" named If people agree to use the same schemas in addition to agreeing on consistent meanings for XML tags, it makes the use of XML an effective way to exchange data. And, in fact, many areas of business are agreeing to agree. For example, there already are DTDs available for many business areas, and businesses within these areas are starting to converge on the use of those DTDs for data interchange.
UDDI
XML is an effective way to exchange data, but how is it used specifically in Web services? One way is to identify a Web service in a registry so that a program looking for a Web service can easily find it and understand what it does. A large consortium representing a wide variety of industries has developed specifications for Web service registration. This cross-industry effort is called the Universal Description, Discovery, and Integration (UDDI) project. The UDDI specifications are becoming one of the generally adopted standards for Web services. The consortium has also implemented the UDDI specifications in a UDDI Business Registry, and it makes the Business registry available to the public for businesses to register their Web services. (UDDI is not the only standard that is commonly used for Web services registration. Another approach that is generally adopted for Web services is ebXML.) Think of a UDDI registry as a "Yellow Pages" for Web services. Like the Yellow Pages directory for phone numbers, a UDDI registry provides simple information about:
Each registry that conforms to UDDI is operated at its own site (the UDDI specifications refer to this as the "operator" site). The operator site contains the master copy of its registry. However, the collection of UDDI registries is replicated. If a business searches for a Web service in a registry at one operator site, the search is done across the information in the master copy, including the information replicated from the other UDDI registries. The UDDI specifications define how to publish and discover information about Web services in a UDDI-conforming registry. More specifically, the specifications define a UDDI schema and a UDDI API. The schema identifies the types of XML data structures that comprise an entry in the registry for a Web service. The API describes the SOAP messages that are used to publish an entry in a registry, or discover an entry in a registry. Note that the current version of the UDDI specifications, Version 3, covers additional features, such as a subscription API that can be used to notify "subscribers" when registry entries of interest change. The UDDI schema and API described below is based on Version 2 -- this is the version that is supported by the Sun ONE Developer Platform tools and servers. UDDI SchemaThe UDDI schema identifies the types of XML data structures that comprise an entry in the registry for a Web service. The following figure illustrates the schema. It shows the five types of XML data structures that comprise a registration.
businessEntity. This structure represents all known information about a business or entity
and the services that it offers. (The reference to "entity" means that an entry
in a UDDI registry does not necessarily have to be for a business. It could be for
other types of enterprises such as schools or research institutions.)
From an XML standpoint, a
Other elements within the structure identify the name recorded for the business
or entity (
Here is an example that shows part of a complete
<businessEntity businessKey="35AF7F00-1419-11D6-A0DC-000C0E00ACDD" authorizedName="0100002CAL" operator="www-3.ibm.com/services/uddi"> <name>BooksToGo</name> <description xml:lang="en"> The source for all professional books </description> <contacts> <contact> <personName>Ramesh Mandava</personName> <phone> (877)1111111 </phone> </contact> </contacts>
businessService. This structure identifies a service provided by the business or entity
that is represented by the parent
Here is an example that shows part of a complete
<businessServices> <businessService serviceKey=" 2AB346C0-2282-43B0-756B-0003CC35CC1D"> <name>Online Book Ordering</name> <description xml:lang="en"> Ordering books online </description> <categoryBag> ntis-gov:naic <catgeoryBag>
bindingTemplate and tModel. A
There can be multiple
Here is an example that shows part of a complete
bindingTemplate structure for the online book ordering service offered by BooksToGo.
Notice the reference to the <bindingTemplates> <bindingTemplate bindingKey=" 4BC7C340-2398-12E6-887C-0005AC33CC2D" <description> JAXRPC (SOAP/HTTP ) based binding </description> <accessPoint> http://www.BooksToGo.com:8080/books/ </accessPoint> <tModelInstanceDetails> <tModelInstanceInfo tModelKey="UUID: 36E13526-4553-3265-B5F7-C4B522E75A05" /> </tModelInstanceDetails>
publisherAssertion. This structure is used as a way of asserting a relationship between
one Continuing with the BooksToGo example, let's assume that it has no relationship that it needs to assert. UDDI APIThe UDDI API describes the Simple Object Access Protocol (SOAP) messages that are used to publish an entry in a registry (the "Publish" API), and those that are used to discover an entry in a registry (the "Inquiry" API).
Publish API. There are a variety of messages defined in the Publish API.
What they have in common
is that they perform some action related to one of the types of structures that comprise the
UDDI schema. For example, the Publish API message
Here, for example, is a message
that saves the <save_service generic="2.0" xmlns=um:uddi-org:api-v2"> <authinfo>authentication token goes here ...</authinfo> <businessServices> <businessService serviceKey=" 2AB346C0-2282-43B0-756B-0003CC35CC1D"> <name>Online Book Ordering</name> <description xml:lang="en"> Use this service to purchase books over the Web </description>
In addition to messages that save or update UDDI structures in a registry, the
Publish API also defines messages that delete these structures. For example,
the
Inquiry API. The Inquiry API contains two types of messages: "find"
messages that search UDDI registries for entries that meet specified search criteria, and
"get" messages that retrieve detailed information about a specified
registration. For example, you use the Inquiry API message <find_business generic="2.0" xmlns=um:uddi-org:api-v2"> <name>Books%</name> </find_business>
The call returns
a
The "get" messages include those that return detailed information about
one or more business entities (
Here, for example, is a <get_serviceDetail generic="2.0" xmlns=um:uddi-org:api-v2"> <serviceKey>"2AB346C0-2282-43B0-756B-0003CC35CC1D"</name> </get_serviceDetail>
SOAP
Though agreeing on the meaning and structure of XML tags makes the use of XML an effective way to exchange data, it's not sufficient for data interchange over the Web. For instance, you still need some agreed-upon protocol for sending XML documents across the Web so that the receiver understands what it's getting, and what to do in response. That's where Simple Object Access Protocol (SOAP) comes in. SOAP is a XML-based protocol for exchanging information in a distributed environment. It's a major underpinning of the communication mechanism for Web services. For example, you register a Web service in a UDDI registry using the SOAP protocol. You also use the SOAP protocol to look for a Web service in a UDDI registry, and once you find the service, you use the SOAP protocol to request it. The SOAP protocol is defined in the SOAP specification. The Sun ONE Developer Platform tools and servers support the current level of the specification, SOAP 1.1. An update to the specification, SOAP 1.2, is close to being finalized. Like UDDI, SOAP is XML based. Also, like UDDI, SOAP is a generally accepted standard for Web services. The reason for SOAP's widespread adoption is its simplicity. SOAP is "lightweight," that is, it involves a relatively small amount of code, and it's fairly easy to understand. The basic item of transmission in SOAP is the SOAP message, which consists of a mandatory SOAP envelope, an optional SOAP header, and a mandatory SOAP body. What those items mean is that if a Web services client exchanges some information with a Web service, what gets exchanged is a SOAP message that conceptually looks like this:
Envelope. The envelope is the top element of the XML document, and is
represented by an
Header. The header is represented by a
Body. The body, represented by a Here's an example of a SOAP message:
<SOAP-ENV: Envelope
xmlns:SOAP-ENV=
"http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:
encodingStyle=
"http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<t:Transaction xmlns:t="some-URI">
SOAP-ENV:mustUnderstand="1">
5
</t:Transaction>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<m:GetLastTradePrice xmlns:m="some-URI">
<symbol>DEF</Symbol>
</m: GetLastTradePrice>
</SOAP-ENV:Body>
</SOAP-Envelope>
The
The
The
If you've guessed that this example has something to do with stock quotes, you're right.
The SOAP message is designed to retrieve the current price of a stock. Specifically,
the SOAP message includes a request for the current stock price ( SOAP for RPC
In a remote procedure call (or RPC), a program (the "client") in one location
in a network requests a procedure (in Java technology terms, a method) from a program
(in Java technology, an object) that is located in another part of the network. The client
can pass parameters as part of the RPC call. In the stock quote example, the RPC call is
to the remote method The remote procedure can return a response to the client (but it doesn't have to). The interaction between the client and the remote procedure is governed by specific rules. In other words, there's a defined protocol that governs how the components interact in an RPC call. Support for RPC is a key objective of SOAP. In fact, the SOAP specification states:
To meet that goal, the SOAP specification includes a section that describes how to represent RPC calls and responses. For example, an RPC call needs to include:
RPC method calls and responses are carried in the SOAP Body element.
In the stock quote example, the
<SOAP-ENV:Body>
<m:GetLastTradePrice xmlns:m="some-URI">
<symbol>DEF</Symbol>
</m: GetLastTradePrice>
</SOAP-ENV:Body>
The response to the method call might look like this:
<SOAP-ENV:Body>
<m:GetLastTradePriceResponse xmlns:m="some-URI">
<price>42.40</price>
</m: GetLastTradePriceResponse>
</SOAP-ENV:Body>
The response to the request for a stock price is in the element
SOAP for MessagingAlthough support for RPC is a key objective of SOAP, the SOAP protocol can also be used for messaging. In messaging, the client sends a document (rather than an RPC call) for the server to process. The document contains information in a format that both the client and server can understand. For example, the document could be something that both the client and server recognize as a purchase order. The server then processes the purchase order, and could return a response (perhaps confirming that the purchase order was received). It's important to understand that the messaging client does not call a specific method -- in the purchase order example, the messaging client does not call a purchase order method. In fact, the client might not know what program on the server actually processes the request. Instead, the client relies on the server to invoke the appropriate application to process the request because the server understands the format of the message it receives. Similarly, what the server returns is not a method response, but rather a response generated by the processing application. This example indicates that the server could return a response, but it doesn't have to. As is the case when using SOAP for RPC, SOAP for messaging does not require that the receiver of a request return a response. In fact, one-way (asynchronous) requests are probably more typical in messaging than two-way (synchronous) requests. The architecture of a SOAP message is the same for messaging as it is for RPC. In both cases, the message contains an envelope, an optional header, and a body. For messaging, the payload in the body is the document passed by the client for processing by the server. Here's an example of a SOAP message used for messaging:
<SOAP-ENV: Envelope
xmlns:SOAP-ENV=
"http://schemas.xmlsoap.org/soap/envelope/"
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<bp:GetBookDetails xmlns:bp="http://bookprovider.com">
<searchCriteria>ISBN</searchCriteria>
<searchValue>0123454321</searchCriteria>
</m: GetBookDetails>
</SOAP-ENV:Body>
</SOAP-Envelope>
Notice that the body contains an element In other respects, SOAP for messaging is similar to SOAP for RPC. SOAP Messages With AttachmentsThe SOAP 1.1 specification does not cover attachments to SOAP messages. For example, if you send a SOAP message that conforms to the SOAP 1.1 specification, you send a payload that either represents an RPC call or that contains a document for messaging. But what if you want to attach something to the SOAP message, say an image? A standard way of doing this is described in the SOAP Messages With Attachments specification. This specification describes how to attach one or more items to a SOAP message, no matter what content these items hold. For example, an attachment can be an image, audio, text, even an XML document. A SOAP message with attachments, which the specification calls a "SOAP message package", conceptually looks like this.
The SOAP Messages With Attachments specification takes a MIME approach in describing how to build a SOAP message package. MIME, which stands for Multipurpose Internet Mail Extensions, is a standard that extends the format of Internet mail to allow for things like multipart message bodies.
A message that conforms to the MIME standard consists of a header and a body. The header
contains various fields that contain information about the message. For example,
the
A
Here's an example of a SOAP message package. The SOAP message is in the root
body part. The value of the
MIME-Version: 1.0 Content-Type: Multipart/Related; boundary=MIME_boundary; type=text/xml; start="<claim061400a.xml@claiming-it.com>" Content-Description: This is the optional message description. --MIME_boundary Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: <claim061400a.xml@claiming-it.com> <?xml version='1.0' ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> .. <theSignedForm href="cid:claim061400a.tiff@claiming-it.com"/> .. </SOAP-ENV:Body> </SOAP-ENV:Envelope> --MIME_boundary Content-Type: image/tiff Content-Transfer-Encoding: binary Content-ID: <claim061400a.tiff@claiming-it.com> ...binary TIFF image... --MIME_boundary-- Notice that the SOAP message refers to the attached image. SOAP 1.1 allows for an accessor to point to a URI. The URI can provide any type of resource, including a non-XML resource such as an image.
WSDL
How does a Web services client know what format to use in making a request to a server? For that matter, how do the client and the server know what the request means? In SOAP for messaging, the answer is that there's a previous agreement about the format and meaning of SOAP messages exchanged between the client and the server. The client and server know what a document representing a purchase order looks like because there's previous agreement about its format. But what about SOAP for RPC? How does a Web services client know what method to call, what arguments to pass, and what to expect in response? In fact, how does the client know to expect a response? The answers to all these questions are provided by information in an XML document, called the WSDL document, that contains a description of the Web service's interface and semantics. A WSDL document contains information specified in Web Service Description Language (WSDL), as defined in the WSDL specification. WSDL defines an XML schema for describing a Web service. To uncover the description for a Web service, a Web services client needs to find the service's WSDL document. One way, perhaps the most typical way, to do this is for the client to find a pointer to the WSDL document in the Web service's UDDI registration. (However the UDDI specification doesn't mandate such a link.) A typical scenario is that a business registers its service in a UDDI registry. The registry entry includes a pointer to a WSDL file that contains the WSDL document for the service. Another business searches the registry and finds the service. A programmer uses the interface and semantic information in the WSDL document to construct the appropriate calls to the service. WSDL DocumentA WSDL document describes a Web service as a collection of abstract items called "ports" or "endpoints". A WSDL document also defines the actions performed by a Web service and the data transmitted to these actions in an abstract way. Actions are represented by "operations", and data is represented by "messages". A collection of related operations is known as a "port type". A port type constitutes the collection of actions offered by a Web service. What turns a WSDL description from abstract to concrete is a "binding". A binding specifies the network protocol and message format specifications for a particular port type. A port is defined by associating a network address with a binding. If a requester locates a WSDL document, and finds the binding and network address for each port, it can call the service's operations according to the specified protocol and message format. Here is an example of a WSDL document. The example illustrates a WSDL document for a service that provides stock quotes. This is the service that was called in the example illustrated in the section on SOAP. Recall that the application that requests this service supplies a symbol for a specific stock. The service responds with the current price of the stock. Notice that the document contains the following elements:
definitions. In WSDL terms, the description of a Web service's
interface is its "definition", marked by the
types. This structure, marked by the
message. The
port type. The
binding. The
service. The
ebXML
While SOAP provides a means to send Web service-related messages, such as those that register a Web service in a UDDI registry or request a Web service operation, it's fairly limited. For example, there's no way in SOAP to describe the larger context of the service, that is, the business process in which the service fits. In the real world, being able to successfully use a Web service might depend on how well the pertinent processes of a requesting business mesh with the processes of a business offering the service. ebXML is designed to provide a comprehensive B2B framework for describing these processes as well as other information so that businesses can successfully collaborate in a global electronic marketplace. The ebXML framework is being developed by the ebXML initiative. This initiative is a joint project of the United Nations Centre for Trade Facilitation and Electronic Business (UN/CEFACT) and the Organization for the Advancement of Structured Information Standards (OASIS), and includes representation from an extremely wide set of businesses and other entities around the world (including standards bodies). The framework consists of a set of ebXML specifications, all of them XML based. A fundamental concept in ebXML is expressed in the following extract taken from one of the ebXML specifications (the Collaboration-Protocol Profile and Agreement Specification):
The CPP and CPA are typically stored in an ebXML registry. Let's examine each of these ebXML components: Collaboration-Protocol Profile (CPP). The CPP is an XML document that contains information about a business (in ebXML terms, a business is referred to as a "Party") and the way it exchanges information with another Party. This can include information about who the Party is (for example, its name and contact information), the services it offers (ebXML calls these "business transactions"), its role in a business collaboration (for example, a "buyer" or "seller"), and details about the message transport it uses, and its security constraints. This information about a business's ebXML capabilities and constraints is also known as a "business profile". The CPP also points to a document called a "Business-Process Specification" that defines the interactions supported by the Party, in other words, the specifics of a collaboration that a Party is capable of implementing. Collaboration-Protocol Agreement (CPA). The CPA is an XML document that describes the specific capabilities that two Parties have agreed to use in a business collaboration. One way to look at a CPA is as an intersection of the CPPs for the two Parties that collaborate. A CPA contains the same type of information as a CPP, but for the two parties involved. This also includes the appropriate reference to a Business-Process Specification. Essentially, a CPA is a contract between the two Parties in a collaboration. It describes the valid, enforceable interactions that can take place between the two parties as part of the collaboration. ebXML Registry. An ebXML registry stores CPPs, CPA, and other information relevant to business collaboration. As is the case for UDDI, ebXML offers services to register and discover information about a business. However unlike a UDDI registry (which points to a WSDL document for a description of a Web service), an ebXML Registry actually contains the description of a business's service within its CPP and associated Business-Process Specification. A high-level view of how these components are used for Web services is as follows:
One other thing to note about ebXML is that two Parties exchange information using the ebXML messaging standard. This standard is based on the SOAP standard. However it extends SOAP in important areas such as security (for example, it adds support for creating and verifying a digital signature) and reliable message handling. The ebXML messaging standard also conforms with the SOAP Messages with Attachments specification, itself an extension of SOAP that enables a user to send attachments with a SOAP message. Java Technologies for Web Services
The content of a Web service, that is, its business logic, can be coded in any programming language. However, for reasons such as portability that make it ideal for application development, the Java programming language is also ideal for building Web services and developing applications that use Web services. Java APIs are available for these purposes. In essence, these APIs provide the mapping between the Java programming language and XML so that Java technology can be used with the XML-based technologies that underlie Web services. These Java APIs are:
These APIs are available in a single package called the Java Web Services Developer Pack (Java WSDP). This package also includes a number of tools that aid in building, testing, and deploying Web services and applications that use Web services. The tools available in Java WSDP are:
All of the Java APIs and tools in the Java WSDP are integrated into Sun ONE Developer Platform tools and servers such as the Sun ONE Studio Enterprise Edition and Sun ONE Application Server. This provides the Java technology foundation for developing and using Web services on the Sun ONE Developer Platform. Java API for XML Registries (JAXR) JAXR is a Java API for accessing standard registries such as those that conform to UDDI or ebXML. Using this API, a Web service provider can publish a Web service in a registry such as a UDDI or ebXML registry. A prospective user, through an application program, can use the JAXR API to search a registry for a Web service. The goal of the JAXR specifications is to support other future registry standards. Support for ebXML Registries using the JAXR API is being developed in an open source project, see the OASIS ebXML Registry Reference Implementation Project (ebxmlrr) for details. Java API for XML-based RPC (JAX-RPC) JAX-RPC is a Java API for accessing Web services through SOAP-based RPC calls (see SOAP for RPC). It allows a Java-based client to call Web service methods in a distributed environment, for example, where the client and the Web service are on different systems. From an application developer's point of view, JAX-RPC provides a way to call a Web service. From a Web service developer's point of view, it provides a way to make a Web service available so that it can be called from an application. JAX-RPC works in conformance with the SOAP 1.1 specification and the SOAP 1.1 with Attachments specification. Java API for XML Messaging (JAXM) JAXM is a Java API for constructing and sending SOAP-based, document-oriented messages (see SOAP for Messaging). Like JAX-RPC, JAXM works in conformance with the SOAP 1.1 specification and the SOAP 1.1 with Attachments specification. What this means is that in a JAXM scenario, documents and responses are SOAP messages or SOAP messages with attachments. What it also means is that JAXM implementations must support the SOAP 1.1 and SOAP 1.1 with Attachments specifications. However a JAXM provider can also support messaging protocols (usually industry-based) that are built on top of SOAP 1.1 and SOAP 1.1 with Attachments, for example, the ebXML Message Service Specification V1.0. Java API for XML Processing (JAXP) JAXP is a Java API for to processing XML documents. For instance, an application can use JAXP to process XML documents returned as output by a Web service. JAXP supports processing of XML documents using the parsing standards Document Object Model (DOM) and Simple API for XML Parsing (SAX). It also supports transforming XML documents in conformance with the XSL Transformations (XSLT) specification. Sun ONE Developer Platform: Tools and Servers for Web Services
The Sun ONE Developer Platform provides a sophisticated set of tools and servers that simplify the development and testing of application portals. Central to the Sun ONE Developer Platform is support for Web services through the Java programming language. The Sun ONE Developer Platform includes the following tools:
The Sun ONE Developer Platform also delivers a complete test and deployment-ready environment through the following servers:
Sun recently made available a technology preview of the Sun ONE Developer Platform as part of the Sun ONE Starter Kit. The technology preview includes a selected set of the developer tools in the Sun ONE Developer Platform:
Support for developing Web services through the Java programming language, and support for developing Java technology applications that use Web services is built into Sun ONE Studio 4. Support for deployed Web services, and support for deployed Java technology applications that use Web services is built into Sun ONE Application Server 7. And support for Web service registration through Java technology is built into Sun ONE Registry Server 1.0. Let's look more closely at the support for Web services built into these tools and servers
Sun ONE Studio 4
Sun ONE Studio 4 is an Integrated Development Environment (IDE) for building Java applications. The latest release, Sun ONE Studio 4 update 1, is available in three editions: Enterprise Edition for Java (this is the edition in the Sun ONE Developer Platform), Community Edition, and Mobile Edition. Sun ONE Studio 4 update 1 Enterprise Edition for Java (for simplicity, it's referred to here as Sun ONE Studio) is an Integrated Development Environment (IDE) for building J2EE applications and components. More than a single tool, Sun ONE Studio is a framework, based on the open source Netbeans platform, that allows you to integrate additional development tools into the IDE. These plugins to Sun ONE Studio include Sun ONE Application Framework, Sun ONE Connector Builder, and Sun ONE Portlet Builder. Other tools can be plugged in as needed.
Sun ONE Studio includes support for building and using Web services. For example, through Sun ONE Studio, you can:
Sun ONE Application Server 7
Sun ONE Application Server 7 is a high performance, small footprint application server. It is available in three editions: Platform Edition, Standard Edition, and Enterprise Edition. Standard Edition is provided in the Technology Preview. Sun ONE Application Server 7 is the first application server to be an exact representation of the J2EE Reference Implementation. In other words, it provides rigorous compliance to the J2EE specification. Sun ONE Application Server 7 integrates the Java Web Services Developer Pack, including all the Java XML APIs. It provides the runtime support for mapping these APIs to the underlying XML technologies, such as SOAP. This makes Sun ONE Application Server 7 an ideal platform for deploying Web services or applications that use Web services. For example, applications that make JAX-RPC calls (perhaps developed with Sun ONE Studio) can be deployed on Sun ONE Application Server 7. Similarly, applications that access a UDDI registry through JAXR, or that exchange document-oriented messages with a server through JAXM, or that process XML documents returned by a Web service can be deployed on Sun ONE Application Server 7. In addition, Sun ONE Application Server 7 provides support for WSDL. Because it supports both SOAP and WSDL, Sun ONE Application Server 7 provides a complete Web services infrastructure, making it an ideal platform for deploying Web services. You can think of Sun ONE Application Server 7 as part of an integrated "end-to-end" Web services platform. Sun ONE Application Server 7 integrates with the Sun ONE Portal Server to deliver a complete portal platform for deploying robust business-to-employee, business-to-business, and business-to-consumer portals. It also integrates with the Sun ONE Directory Server. This helps enterprises extend the core directory capabilities of the Sun ONE Application Server to provide centralized policy, user management, and single sign-on capabilities. The Sun ONE Application Server also integrates with the Sun ONE Integration Server through the Java Message Service interface to provide a complete business process management, enterprise application integration, and business-to-business integration platform.
Sun ONE Registry Server
The Sun ONE Registry Server is a UDDI registry provider, that is, it implements the UDDI specifications --- specifically UDDI Version 2. Sun ONE registry server implements all of the UDDI Version 2 API functions. However Sun ONE Registry Server is targeted for private registry deployments, such as an intranet web service registry used to consolidate department services for a particular company or a business partner registry used to store partner services accessible over public and private networks. It is not designed for UDDI publicly registry deployments -- this kind of registry implements the UDDI replication specifications to replicate individual UDDI registries. Sun ONE Registry Server does, in fact, support registry replication. However it uses the the replication facility of the Sun ONE Directory Server. A Web service provider can publish information about a Web service to the Sun ONE Registry Server, and Web service clients can search for Web services in the Sun ONE Registry Server. These tasks can be performed through applications and tools that support JAXR (such as Sun ONE Studio 4 update 1 Enterprise Edition for Java) or that otherwise generate UDDI-conforming (such as IBM's UDDI4J and the Microsoft .Net UDDI Toolkit). Summary
Standard protocols and XML-based technologies such as UDDI, WSDL, and SOAP make Web services a reality. They allow for business application-to-service communication that's workable. Java APIs for XML, such as JAXR, JAX-RPC, JAXM, and JAXP, are available today. These technologies make it easy to make Web service-related requests or perform Web service-related actions in a Java program. Importantly, these APIs are built into a number of tools and servers in the Sun ONE Developer Platform. This makes the Sun ONE Developer Platform an excellent choice for developing and deploying Web services, and for developing and deplopying applications that use Web services. For More Information
Sun ONE Developer Platform product home page and data sheet.
Using XML and Java Technology to Develop Web Services: Keeping Migration Paths Open
Java Web Services Developer Pack Part 1: Registration and the JAXR API.
Java Web Services Developer Pack Part 2: RPC Calls, Messaging, and the JAX-RPC and JAXM API.
Deploying Web Services on Java 2, Enterprise Edition (J2EE)
Sun ONE Developer technical Articles
Developing Web Services with Sun Open Net Environment
Web Services Made Easier: The Java APIs and Architectures for XML About the Author
Ed Ort is a staff member of the Java Developer Connection. He has written extensively about relational database technology and programming languages. | |||||||||||||||||||||||||||||||||||||
|
| ||||||||||||