Getting Started On Developing Web Services
Getting Started On Developing Web Services
The concept of Web services is the latest in the evolution of ever more modular and
distributed computing. The industry as a whole has embraced it as the next big thing
despite its technical immaturity. What does this mean to developers? It means that,
without risk of investing in a technology that might lose steam and disappear, you can
become an early adopter, hone your skills, and contribute to its evolution. This article
addresses the topic in the following segments:
• What Are Web Services?
• Web Services Standards
• Implementing Web Services
• What You Need to Know About Today's Web Services Paradigm
• Are You Ready to Develop Web Services?
• Development Tips
• Conclusion
• WSDL (Web Service Description Language), the proposed standard for how a
Web service is described, is an XML-based service IDL (Interface Definition
Language) that defines the service interface and its implementation
characteristics. WSDL is referenced by UDDI entries and describes the SOAP
messages that define a particular Web service.
2. The service provider uses WSDL to describe the service (to a UDDI registry).
3. The service provider registers the service (in a UDDI registry and/or ebXML
registry/repository).
4. Another service or user locates and requests the registered service by querying
UDDI and/or ebXML registry(ies).
5. The requesting service or user writes an application to bind the registered service
using SOAP (in the case of UDDI) and/or ebXML.
• Use your knowledge of other kinds of distributed systems. The toolsets you'll
use will be different, but if you have CORBA and EJB architecture training, you'll
be able to transfer your existing design knowledge to Web services development.
• Draw upon your knowledge of servlets, JSP pages, EJB architecture, and
other J2EE technologies. These skills will be extremely useful in Web services
development.
• Learn XML programming skills. The simple fact is that XML is ubiquitous in
Web services architecture because it is open, vendor-supported, and standardized.
You can expose assets and services using WSDL and proxy-generation tools,
which shield you from the underlying messages carried by XML packets in Web
services. However, depending on how deeply you go into Web services, low-level
XML programming skills may be important. Many tools aren't yet fully capable
of shielding you from the details. So if you're developing complex systems, you
may need to write programs that interact with the low-level XML.
• Study XML standards. Web services tools will eventually make XML
transparent, but for now, it's essential that you become comfortable with XML
standards based on SOAP, WSDL, UDDI, or ebXML.
• Learn the tools your organization has chosen for Web services development.
Some of the tools available now are the Forte[tm] for Java[tm] IDE, Oracle
JDeveloper, and WebGain Studio. The future will bring tool suites such as the
J2EE[tm] Web Services Pack that will incorporate JavaServer[tm] Faces, a
standard API for creating GUIs; Tomcat, for implementing JSP pages and servlet
technologies; and the JAX Pack, a collection of XML-based Java APIs for XML
processing registries, messaging, binding, and remote procedure calls (RPC).
Development Tips
Here's what you'll need to consider once you begin designing Web services:
• Requesting a service: Web services have all the same issues as those of
distributed systems. If you've never developed distributed computing systems,
you need to be aware that the service you've requested from a machine over the
network may be a very heavyweight operation, even if it's represented by a single
line of code. Keep in mind that a local operation is much cheaper than a
distributed operation.
• Control issues: As a developer, you may think of an application as something to
build and control -- and if it doesn't work, you can grab and modify it. However,
with Web services you will be tapping into software modules that are not under
your control. Most of the time, the data or service you request will be sent to you
and everything will work fine. But you'll need to plan for the time when it doesn't
work -- maybe the administrator for the system you're calling (that worked just
fine for months) updated the system to a new version that doesn't work with your
application. So make sure to program in a "Plan B."
Conclusion
Web services are here to stay, and the good news is that you can transfer a lot of your
existing J2EE technology skills and knowledge of distributed systems to make the shift.
There are plenty of challenging and creative opportunities as only a few development
tools are available at this time. So you'll be working at the nuts and bolts level, as well as
making independent decisions because few standards are solidly in place at this time.
However, you can look forward to participating in the evolution of these standards and
using tools with better integration and reliability as the industry grows.
Registry/Repository
Registry Services Specification v1.0/Registry Information Model v1.0
At the hub of ebXML's technical framework are distributed repositories containing all the
necessary XML artifacts for participants to discover and learn about other potential
business partners, establish working agreements, and engage in business transactions.
Repository items can and ultimately should include core components, message
definitions, XML schema, DTDs, and the XML-based business process models and
documents.
Business entities (designated as trading partners) participating in ebXML transactions
are represented within these repositories by XML documents called Collaboration
Protocol Profiles. These CPPs contain data about each trading partner's organization and
services, along with information about how this data is structured and represented. (See
the next section for more information about CPPs.)
ebXML registry services provide storage and interface capabilities for the repository's
CPPs and other contents, which also includes business-modeling information about the
registry itself. Registry and repository functionally perform together as a database, with
shared information maintained in the repository as objects that are managed and queried
through registry services. One of the unique aspects of the registry/repository is the
provision for a classification capability that allows classifications to inherit from other
classifications, enabling powerfully agile repository querying.
Because registries lie at the heart of implementing ebXML, registry services are likely to
attract much initial ebXML development activity. "There will be many more developers
of registry services than implementers of registries themselves," predicts Tim McGrath,
who served as team lead and editor for the ebXML Quality Review Committee, tasked
with reviewing all the specifications, technical reports, and white papers for release.
"Registry services will most likely be integrated with other Web services, for example, a
directory service that supports Universal Description, Discovery, and Integration (UDDI)
and drills down into an ebXML registry. One technical issue still remaining with registry
services is the nature and sophistication of the querying capabilities. I would imagine that
this will be addressed as part of the next specification revision."
One potential implementation scenario is for registries to be built and operated as value-
added services by third-party service providers -- similar to an Electronic Data
Interchange (EDI) value-added network or an Internet application service provider.
Attracting, building, and maintaining repository content will be one of the largest tasks in
implementing ebXML.
• The Transport layer describing the technical details (such as endpoint address,
protocol and transport-level security) of the underlying transport protocol (for
example, HTTP).
Collaboration Protocol Agreements (CPAs) represent the technical rules of engagement
for each collaborative business event between two trading partners. A CPA can be
thought of as a shared configuration file derived from trading partners' stored profile
information that ensures technical interoperability between the software at each end. The
CPA provides a canonical means of representing in non-proprietary form all the elements
required by server software, including:
• Interactions between two trading partners, such as messaging transport security
issues.
Messaging Services
Message Service Specification: ebXML Transport, Routing and Packaging v1.0
A messaging service protocol to enable secure, reliable message exchange between
parties is the most mature ebXML specification to date. The ebXML Message Service is
a formally specified set of Simple Object Access Protocol (SOAP) extension elements
and their associated semantic meaning and behavior. Aligning ebXML messaging with
the broadly implemented SOAP protocol signals a technically and strategically
significant move by starting down a clear convergence path between full-blown B2B e-
business and Web services.
ebXML messaging is designed to meet an array of business types and needs through its
essential characteristics: simplicity, reliability, and modularity. By building upon open
standards, such as SOAP and JAXM (Java APIs for XML messaging), businesses are
able to adapt ebXML-messaging implementations to existing code bases.
Core features of the ebXML messaging spec include:
• Packaging specification describing how to package ebXML messages for a
variety of communications protocols, including HTTP, SMTP, and FTP. A
complete message package is a MIME multipart/related object. MIME types are
used to describe all message package contents. The two principal parts of the
message package are a SOAP message container and optional payload containers.
ebXML packaging is defined by the SOAP Messages with Attachments Note
published to the W3C.
• Secure message exchange through use of the joint W3C/IETF XML signature
standard enabling authentication of digitally signed messages, message payload
encryption capabilities based on MIME-based cryptographic standards such as
S/MIME and PGP/MIME, and interoperability with other network protocol
security standards such as SSL and IPSEC.
• An XML version of the same thing, which also serves as the rule book for
converting non-XML business process specs into XML documents.
• Production rules to map UML modeling to XML for the purpose of generating a
DTD of ebXML business process specifications.
• Specification schema defining the XML "business signals" necessary for ebXML
transactions. Business signals are application-level XML documents with a
specific purpose that is separate from protocol and transport signals.
The BPSS references, but does not define, ebXML business documents. Instead, business
documents are defined as the "points of intersection" between the BPSS and ebXML core
component specifications. Actual ebXML business documents can either be defined
externally or structured by ebXML core components. Together, the BPSS and XML
business documents form the basis of ebXML trade agreements.
So how does BPSS relate to the rest of ebXML architecture? The BPSS requires that any
ebXML business-modeling methodology either uses or supports UN/CEFACT Modeling
Methodology. This UN-established modeling methodology provides process modeling
for different business viewpoints: operations, requirements, transactions, and services.
From a purely technical level, modeling serves as a means for describing business
processes in a manner that can be turned directly into executable software code. Thus, the
specification's authors have stipulated the use of UMM for ebXML theoretically to
encourage globally consistent software modeling. However, this has turned out to be a
somewhat controversial aspect of ebXML for various reasons, not the least of which
being the vast amount of legacy business software potentially bearing no relation to
UMM. But for the purpose of designing ebXML-compliant software, the BPSS is
designated as a subset of UMM with certain elements defined specifically for ebXML.
Core Components
Core Component Overview Technical Report Document Version 1.05
Core components of ebXML are works in progress. Developing core components
involves capturing and aggregating real-world business concepts. Vendors will be the
ones to implement core components by specifying their business processes in XML terms
and then building the tools and APIs needed to bridge their enterprise applications to
ebXML. As these hand-coded building blocks multiply and grow into part of ebXML
infrastructure, more and more will become automated components and evolve into
reusable software commodities.
As such, no formal specifications for core components exist yet, however numerous
technical reports detail critical aspects of core component development including
definition, purpose, context, discovery, naming conventions, structure, and dictionaries.
This is part of ongoing ebXML work now absorbed by UN/CEFACT, which established
an Electronic Business Transition Ad Hoc Working Group (eBTWG) to manage a range
of core component and business process management projects.
XML Schemas
XML Schemas define the syntax of ebXML document structure and provide the basis for
constructing libraries of definitions for commonly used business objects. These are to be
text-based and structured according to ebXML business modeling. However, the ebXML
specs do not delve into XML syntax with respect to document contents. In fact,
UN/CEFACT and OASIS have made it official policy to remain neutral toward the
matter of XML content syntax. This may be one of the more confusing aspects
surrounding ebXML. Although expectations of defining an XML standard geared to "e-
business" might understandably include delivering a specific set of XML DTDs for
things like "Purchase Order" or "Invoice," this is not the case.
The expectation is that ebXML implementers will develop their own XML expressions
for core component definitions as needed. Recognizing that syntax conventions and
programming languages tend to evolve over time, the ebXML specifications instead
attempt to distill only what is known about commonly used business data objects.
Industry groups such as EAN/UCC (European Article Numbering/Uniform Code
Council), AIAG (Automotive Industry Action Group), OAG (Open Applications Group),
and GCI (Global Commerce Initiative) and technology providers like Commerce One and
Ariba are at work now on how to define their XML documents for ebXML-compliance.
However, that is outside the purview of ongoing ebXML work by UN/CEFACT, which
has officially adopted a "syntax-neutral" policy. Eventually the IT industry's inherent
process of natural selection is expected to yield a specific XML syntax for electronic
business that can become the de facto standard through implementation. More recently,
the newly established OASIS Universal Business Language committee has begun
developing context-specific, real-world XML instantiations of ebXML core components.
ebXML specs are based upon W3C XML Schema language specifications although these
are not yet formally part of ebXML. The current versions of ebXML specs were drafted
at a time when W3C had not yet made an official recommendation for XML Schemas.
Now that this has happened, OASIS technical committees are modifying the ebXML
specifications to align with the W3C. OASIS working groups are also addressing errors
and other issues discovered by ebXML implementers to be included in revised specs,
expected by year-end 2001.
The layers in this table illustrate where UDDI fits in with the rest of the protocols in the
Web services Interop Stack. Following is a detailed description of the stack's elements:
• Common Internet Protocols such as HTTP (and to a certain extent SMTP) lend
the basic communication framework for Web services, even though Web services
need not necessarily be tied to one of these protocols.
• XML is fast becoming the universal standard for exchange of data and its
structure, and forms the foundation of Web services. This article assumes readers
have a basic familiarity with XML. A good introduction to the language is XML
Distilled: Essential Ingredients for Today's Web Applications.
• UDDI defines a way to publish and discover information about Web services. A
UDDI registry cloud, or business registry, provides "register once, published
everywhere" access to information about Web services.
It must be noted that UDDI/SOAP are not the only models for discovery and messaging
in Web services. ebXML has been developed to do much the same, as well as provide a
business software interface, robust security, and other functions that allow for real e-
business transactions. ebXML and UDDI/SOAP are complementary technologies and
you may, in the long run, end up with both methods in place.
• Yellow pages also parallel their phone equivalent and include industrial
categorizations based on standard taxonomies, such as NAICS, UN/SPC, SIC
code, and so on. Registering information such as industry codes, product codes,
geography codes, and business identification codes (for example, D&B D-U-N-S
Numbers) allows other search services to use this core classification information
as a starting point to provide better indexing and classification. ZipZapZoom
would categorize itself as a Shipping and Delivery Service under the Couriers
subcategory in the Transportation and Warehouse category, as per the NAICS
classification (NAICS Category number 49211).
• Green pages contain the technical information about services exposed by the
business. They include references to specifications for Web services as well as
support for pointers to various file and URL-based discovery mechanisms if
required. UDDI registry nodes store the preceding information and replicate the
data among them to provide the same directory of information from any of the
nodes. This system is quite similar to how domain names are looked up in the
Web using the DNS architecture.
Each of these four XML structures contains a number of fields that serve a business or
technical descriptive purpose. For a detailed explanation of each of these structures,
please refer to the UDDI Data Structure reference document. These structures are
described in the UDDI API Programmer's API Specification and XML Schema.
As illustrated by the bold and dotted lines in the figure, the businessEntity structure
contains one or more unique businessService structures. Similarly, individual
businessService structures contain specific instances of bindingTemplate data, which in
turn contain information including pointers to specific instances of tModel structures. For
a UML representation of these structures, refer to Modeling the UDDI Schema with
UML.
Let's look at each of the previous structures in greater detail:
• businessEntity: This structure captures information about a business or entity and
is used by the business to publish descriptive information about itself and the
services it offers. From an XML standpoint, the businessEntity is the top-level
data structure that holds descriptive information about a business or entity.
Service descriptions and technical information are expressed within a
businessEntity. The businessEntity structure has a unique key that identifies the
business and data that are typically found in the "Yellow pages" and "White
pages" of UDDI. The partial businessEntity structure (with key elements
highlighted) for ZipZapZoom courier, with contact information for its CEO and
COO, as Sir Speedy, follows:
<businessEntity authorizedName="0100003PAJ"
operator="www.ibm.com/services/uddi"
businessKey="83B31400-7581-11D5-
889B-0004AC49CC1E">
<discoveryURLs>
<discoveryURL useType="businessEntity">
http://www-3.ibm.com/services/uddi/
testregistry/uddiget?businessKey=
83B31400-7581-11D5-889B-0004AC49CC1E
</discoveryURL>
</discoveryURLs>
<name>ZipZapZoom Courier</name>
<description xml:lang="en">
Fast and reliable Shipment services
</description>
<contacts>
<contact useType="CEO,COO">
<description xml:lang="en">
All-in-All of the company</description>
<personName>Sir Speedy</personName>
<phone useType="Work">
123-456-7890</phone>
<email useType="">
[email protected]</email>
</contact>
</contacts>
• bindingTemplate: This structure presents the important data that describes the
technical characteristics of the given service implementation. IT has the
information required to actually invoke the service. Each bindingTemplate has a
single logical businessService parent, which in turn has a single logical
businessEntity parent. Each bindingTemplate has a unique binding key, the
associate service key, and most importantly the accessPoint, and
tModelInstanceDetails. The accessPoint represents the address for calling a given
Web service. This could be a URL, an e-mail address, or, if you can believe it, a
telephone number.
<businessServices>
<businessService serviceKey="
7BB589E0-7586-11D5-889B-0004AC49CC1E"
businessKey="83B31400-7581-11D5-
889B-0004AC49CC1E">
<name>calculateShipping</name>
<description xml:lang="en">
Given the type of service and the weight,
the shipping cost is calculated</description>
<bindingTemplates>
<bindingTemplate bindingKey="
7BB6C260-7586-11D5-889B-0004AC49CC1E"
serviceKey="7BB589E0-7586-
11D5-889B-0004AC49CC1E">
<description xml:lang="en">
The shipping cost can be obtained by
calling the given number
</description>
<accessPoint URLType="phone">
123-456-7890</accessPoint>
<tModelInstanceDetails>
<tModelInstanceInfo tModelKey="UUID:
38E12427-5536-4260-A6F9-B5B530E63A07" />
</tModelInstanceDetails>
</bindingTemplate>
You can view the Complete XML structure (containing all the structures) for
ZipZapZoom. If your browser cannot read XML, you can save the file as XML and open
it using any text editor.
It is strongly recommended that you examine the XML (from a DOM perspective) for a
good understanding. In addition to these core structures, there are a few "helper"
structures that I'll examine as needed.
Publish
The messages in the Publish API represent commands that are used to publish and update
information contained in a UDDI-compatible registry. Each business should initially
select one Operator Site to host its information. Once chosen, information can only be
updated at the site originally selected. Invoking the methods in Publish API requires
authorization and is usually done through a secure mechanism. HTTPS is used for all the
methods in the Publish API. This API consists of the following functions:
• Four messages to save each of the four structures: save_business,
save_service, save_binding, save_tModel. Each save message
accepts as input the authToken and one or more corresponding structures. For
example, the save_business takes as input one or more businessEntity
structures. Alternatively, each save function will also accept as a parameter an
uploadRegister element that can be resolved to an HTTP URL address. The
URL must return a pure XML document that only contains the corresponding
structure expected by the save method.
Find
The messages in the Inquiry API represent queries that anyone can make at any UDDI
registry. The messages can be categorized into two broad patterns -- namely, browse and
drill down:
• Browse: UDDI provides four types of calls under this pattern, and you guessed it,
one for each of the four data types. Typically, a find_business is invoked
with any partial information that is available, and this returns a businessList
structure, which is an abbreviated set of key information from the businessEntity
structure. The businessList can be iterated through for a suitable match, and then
the find_service message can be used to get to particular service types. Each
of the find calls also accepts an optional findQualifiers element that alters
the default search behavior. Examples of findQualifiers include
"exactNameMatch," "caseSensitiveMatch," "sortByNameAsc," and
so on. The find calls also provide a maxRows attribute that specifies the
maximum number of search results to be returned.
• Drill Down: If a key for one of the four main data types is available, the key can
be used to get information regarding a specific instance of that data type. The get
call can be used to get information regarding any of the data types, given the key.
Thus we have a get_businessDetail, get_serviceDetail,
get_bindingDetail, get_tModelDetail, and finally a
get_businessDetailExt, that provides extended businessEntity
information.
• Verify the data returned by get_bindingDetail and invoke the service using
the "new" bindingTemplate if data returned by get_bindingDetail is
different from the cached information.
• Replace the cached information with the new information obtained if the
invocation is successful.
Summary
This article introduces the technical aspects of UDDI, an evolving standard for locating
businesses and invoking the services they provide. It details the core structures of UDDI
and frequent ways in which they are used, and it illustrates UDDI in action with a sample
find_business application.
Overview of SOAP
Introduction
SOAP, to put it simply, allows Java[tm] objects and COM objects to talk to each other in
a distributed, decentralized, Web-based environment.
More generally, SOAP allows objects (or code) of any kind -- on any platform, in any
language -- to cross-communicate. At present, SOAP has been implemented in over 60
languages on over 20 platforms. Suddenly objects everywhere, local and remote, large
and small, are able to interoperate. Brad Pitt and Edward Norton, like two very different
object types, are finally able to communicate.
In this technology review, I will present SOAP initially in the larger context of Web
services, as a protocol that is paired with UDDI (Universal Description, Discovery and
Integration) to provide registry and messaging services among businesses. I will also
discuss the Web-based underpinnings of the emerging publish-find-bind paradigm, and
reveal the mechanisms of SOAP packaging, transport and delivery.
Network Tiers
Three network tiers are evident in the evolution of Web services: TCP/IP, HTTP/HTML,
and XML. These tiers build successively on top of each other and remain compatible
today.
The first tier, the TCP/IP protocol, is concerned primarily with passing data across the
wire in packets. A protocol that guarantees transmission across public networks, TCP/IP
emphasizes reliability of data transport and physical connectivity. Originally the putty
holding proprietary networks together, it's now the backbone protocol of the Web on
which higher-level, standard protocols such as HTTP rely.
The second tier, HTML over HTTP, is a presentation tier and concerns itself with
browser-based search, retrieval and sharing of information. The emphasis here is on GUI-
based navigation and the manipulation of presentation formats. In many ways, HTML is
more show than go and lacks both extensibility and true programming power.
Nonetheless, sharing hypertext-linked documents in a browser-based environment
revolutionized the way humans communicate text-based information to one another.
Networked desktop environments, burdened with proprietary operating systems and
platform dependent software, are slowly but surely giving way to the standards-based,
open-systems computing of the Internet.
Leading the charge into this brave new standards-based world is XML, the third and
possibly the most compelling tier on the Internet. XML, a strongly-typed data interchange
format, provides a new dimension to the HTTP/HTML tier, one in which machine-to-
machine communication is made possible through standard interfaces. This layer --
variously described as A2A (application to application), B2B (business to business) or
C2C (computer to computer) -- allows programs to exchange data formatted in a
platform- and presentation-independent manner. XSLT style sheets may be added as an
optional presentation and/or transformational component.
Message Format
SOAP does all this in the context of a standardized message format. The primary part of
this message has a MIME type of "text/xml" and contains the SOAP envelope. This
envelope is an XML document. The envelope contains a header (optional) and a body
(mandatory). The body part of the envelope is always intended for the final recipient of
the message, while the header entries may target the nodes that perform intermediate
processing. Attachments, binary or otherwise, may be appended to the body.
SOAP provides a way for the client to specify which of the intermediate processing nodes
has to deal with what header entry. Because headers are orthogonal to the main content of
the SOAP message, they're useful in adding information to the message that doesn't effect
the processing of the message body.
Headers, for example, may be used to provide digital signatures for a request contained in
the body. In this circumstance, an authentication or authorization server could process the
header entry -- independent of the body -- stripping out information to validate the
signature. Once validated, the rest of the envelope would be passed on to the SOAP
server, which would process the body of the message. A closer look at the SOAP
envelope will help to clarify the placement and purpose of SOAP header and body
elements.
<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>
In this example, a GetLastTradePrice request is being sent to a stock-quote service
somewhere on the Web. The request takes a string parameter, a ticker symbol, and
returns a float in the SOAP response.
The SOAP envelope is the top element of the XML document that represents the SOAP
message. XML namespaces are used to disambiguate SOAP identifiers from application
specific identifiers. XML namespaces are used heavily in SOAP to qualify or scope
elements in the message to a specific domain. To understand SOAP namespaces, it helps
to be familiar with the namespace spec for XML. If you're not, simply think of
namespaces as neighborhood identifiers that help uniquely identify SOAP elements by
associating them with specific locations, real or imagined.
Namespaces
The first namespace in the example references the SOAP schema, which defines the
elements and attributes in the SOAP message. The second namespace refers to SOAP
encodings, the "Section 5" data types discussed earlier. Since no additional per-element
encoding is specified, this encoding applies to the whole document.
Header
The first element identified in this sample SOAP envelope header is a transaction
element, accompanied by a namespace attribute and by the mustUnderstand attribute
with a value of 1. Since mustUnderstand is set to 1, the server accepting this
message must perform intermediate processing on this transaction node. You can
interpret this to mean that the server and client have previously agreed upon the
semantics that govern the processing of this header element, so that the server knows
exactly what to do with the contents of the element, in this case 5.
If the server receiving this message doesn't understand the semantics of the transaction
header, it is required to reject the request completely and throw a fault. A fault element is
a special part of the SOAP body and a well-defined mechanism to ship error information
back to the client.
Intermediate processing nodes like this are an example of SOAP's extensibility. Clients
include such nodes in a SOAP message to indicate that special processing needs to take
place before the contents of the message body can be processed. Ensuring backward
compatibility with existing servers not capable of providing such processing is simply a
matter of setting the mustUnderstand attribute to 0, which makes the action optional.
In addition to defining transaction nodes like the one described above, a SOAP message
may optionally contain header entries specifying nodes that perform authorization
processing, encryption, persistence of state, business logic processing and so on. Headers
help make SOAP a modular, extensible packaging model. Just keep in mind that header
processing is entirely independent of the SOAP message body.
Body
The SOAP body in the example contains an XML payload, which we can surmise,
without really seeing it spelled out for us, does RPC. SOAP is not only a modular
packaging model, it's also a fairly cryptic packaging model.
Nothing here explicitly shows that RPC is begin done. All we see in the body are a
couple of XML elements, one qualified by a namespace. It's up to the SOAP server to
understand the document semantics and do the right thing. The server, in effect, provides
a framework for dealing with the XML payload in a meaningful way. "Meaningful" here
implies that the server invokes a remote procedure call on some back-end database to
receive the stock price for the stock-symbol element contained in the message body. All
the magic takes place behind the SOAP RPC curtain.
SOAP-RPC
SOAP messages are fundamentally one-way transmissions from a sender to a receiver,
but SOAP messages are often combined to implement request/response mechanisms. To
do RPC using SOAP, a few conventions must be followed. First of all, request and
response messages must be encoded as structures. For each input parameter of an
operation, there must be an element (or member of the input structure) with the same
name as the parameter. And for every output parameter, there must be an element (or
member of the output structure) with a matching name.
Here's a foreshortened, RPC-based view of the SOAP message presented earlier. Only
the body portions of the SOAP request and response envelopes are shown.
Request
<SOAP-ENV:Body>
<m:GetLastTradePrice xmlns:m="some-URI">
<symbol>DEF</Symbol>
</m:GetLastTradePrice>
</SOAP-ENV:Body>
Response
<SOAP-ENV:Body>
<m:GetLastTradePriceResponse xmlns:m="some-URI">
<price>22.50</price>
</m: GetLastTradePriceResponse>
</SOAP-ENV:Body>
The request invokes the GetLastTradePrice method. Notice the response defines a
GetLastTradePriceResponse operation. A convention common to SOAP calls
for appending Response to the end of a Request operation to create a Response
structure. This output structure contains an element called price, which returns the results
of the method invocation, presumably as a float.
It's important to note that nowhere in the SOAP envelope are data types explicitly
delineated, so we really don't know the type of the symbol or the type of the result
parameter price just by looking at the SOAP message. Client applications define data
types either generically through "Section 5" encodings, or privately via agreed-upon
contracts with servers. In either case, these definitions are not explicitly included in the
SOAP message.
Finally, in order to do RPC, a lower-level protocol like HTTP is needed. Although the
SOAP 1.0 specification mandated the use of HTTP as the transport protocol, SOAP 1.1 1
(and its sister specification "SOAP Message with Attachments") permit the use of FTP,
SMTP or even (possibly) raw TCP/IP sockets. All the serialization and encoding rules
general to SOAP apply to RPC parameters as well.
Now that you've seen the SOAP envelope in detail, it helps to pull back a little and view
SOAP from a use-case perspective to grasp the round-trip processing that takes place in a
distributed Web environment. Here are a few broad, summary propositions that form the
conceptual backbone of Web services and SOAP.
• A client application somewhere on the Internet consumes Web services.
• Web services (via SOAP) expose object methods.
• Object methods access remote data anywhere on the Web.
Applying transitive logic to these network propositions, we can deduce the whole point of
Web services and SOAP: Clients somewhere consume data anywhere on the Web. QED.
Here's the use case in a little more detail.
1. A SOAP client uses the UDDI registry to locate a Web service. Rather than
manipulate WSDL directly, in most cases a SOAP application will be hardwired
to use a particular type of port and style of binding, and it will dynamically
configure the address of the service to be invoked to match the ones discovered
through UDDI.
3. The client sends the SOAP message to a JSP or ASP page on a Web server
listening for SOAP requests.
4. The SOAP server parses the SOAP package and invokes the appropriate method
of the object in its domain, passing in the parameters included in the SOAP
document. Optionally, intermediate processing nodes may have performed special
functions as indicated by SOAP headers prior to receipt of the message by the
SOAP server.
5. The request object performs the indicated function and returns data to the SOAP
server, which packages the response in a SOAP envelope. The server wraps the
SOAP envelope in a response object, such as a servlet or a COM object, which is
sent back to the requesting machine.
6. The client receives the object, strips off the SOAP envelope and sends the
response document to the program originally requesting it, completing the
request/response cycle.
Summary
SOAP is an XML-based protocol for sending messages and making remote procedure
calls in a distributed environment. Using SOAP, data can be serialized without regard to
any specific transport protocol, although HTTP is typically the protocol of choice.
SOAP is good for building platform and language-neutral systems that interoperate.
Overall, SOAP and Web services account for everything needed to build a distributed
application infrastructure on top of XML. SOAP minimizes the problem of multiple-
platform incompatibilities in accessing data by resolving the conflict between the COM
and Java component object models.
To return to the metaphor that kicked off this discussion, SOAP is the perfect medium for
object entities of all types -- even Hollywood types like Brad Pitt and Edward Norton --
to use as a communications medium. As in the film, expect the results of this new
technology to be earth-shaking.
Overview of ebXML
ebXML is a joint initiative of the United Nations (UN/CEFACT) and OASIS, developed
with global participation for global use. This partnership brings a great deal of credibility
to ebXML, representing major vendors and users in the IT industry and support from
leading vertical and horizontal industry groups including RosettaNet, OTA (Open Travel
Alliance) and many others. Membership in ebXML is open to anyone, and the initiative
enjoys broad industry support with hundreds of member companies, and more than 1,400
participants drawn from over 30 countries.
The fundamental goal of ebXML is to create a single global electronic market. This is
accomplished by developing a single set of internationally agreed-upon specifications,
which are developed with the following goals in mind:
• Enable simple, easy and ubiquitous electronic business through the use of XML.
• Minimize costs of doing business electronically.
• Maintain full compliance with W3C XML technical specifications.
• Provide multilingual support.
• Maximize interoperability and efficiency while providing a transition path for
EDI (Electronic Data Interchange).
ebXML was designed primarily for business-to-business interaction. The Web services
protocols UDDI (Universal Description, Discovery and Integration) and SOAP (Simple
Object Access Protocol) provide services that perform many similar functions, but
ebXML is much broader than these standards in scope and functionality. In the real
world, companies will likely use both UDDI/SOAP and ebXML. Both solutions are built
on open standards and rely heavily on XML. For these reasons, ebXML and
UDDI/SOAP may work together through gateways to permit access to even more
businesses.
Architectural Overview
For enterprises to be able to conduct business with each other they must:
• Discover what products and services are being offered.
• Determine which shared process and information exchanges to use for obtaining
these products or services.
• Determine the contact points and establish a form of communication for the
exchange of business documents.
• Agree on the contractual terms, contact points and form of communication.
Once these steps are completed, enterprises can conduct business based on a process
upon which everyone agrees. ebXML is designed to provide this process and is built on
three basic concepts:
1. A robust, reliable, and secure communications infrastructure.
2. A mechanism for modeling business information and processes.
3. A marketplace that allows enterprises to find each other, agree to become trading
partners and conduct business with each other.
Communications Infrastructure
The communications infrastructure is provided through:
• A message transport mechanism with a standard, well defined interface, standard
packaging rules, and predictable delivery and security.
• A "business service interface", i.e., a piece of software that sits at each business to
handle incoming and outgoing messages.
• Integration to existing back-office applications. (This is currently out of the scope
of ebXML, but it probably represents both the biggest challenge and the biggest
opportunity for software providers.)
Business Modeling
Business modeling is provided via the following elements of the ebXML standard:
• A specification for defining business processes and information models.
• A set of reusable business objects based on core components.
• A process for defining message structures.
Marketplace
The marketplace to allow enterprises to find each other and agree to become trading
partners is provided by the following elements of the ebXML standard:
• A shared repository (registry) where enterprises can register and discover each
other.
• A process for defining and agreeing to a formal Trading Partner Agreement
(TPA).
Defining Transactions
Once the models are prepared in the correct format, an ebXML system can accept them
and build a state machine that can conduct business based on the specified rules. The
rules define transitions between a series of states in the process. For example, a state
transition could be something like "purchase order sent" to "acknowledged purchase
order received."
The above order transaction acknowledges a purchase order within a specified time. P2D,
P3D, and P5D are time durations, i.e., period two days, period three days and period five
days, respectively.
Specification Goals
The ebXML messaging specification was developed with the following goals in mind:
• Reliable messaging
• Support for a variety of communication protocols (HTTP, SMTP, and so on)
• Support for information of any type
• Simple implementation
• Support for enterprises of all sizes
• Leveraging existing standards wherever possible
Message Acknowledgment
Reliable exchanging messages means that, with respect to sending and receiving
messages, the following is true:
• For any given message sent, the messaging service delivers, at most, one copy of
the message to the receiving application.
• A positive acknowledgment is sent from the receiving messaging service to the
sending messaging service, indicating that the message has been received and
stored persistently.
• If an acknowledgment is not received, the sending messaging service will notify
the sending application.
Summary
ebXML allows businesses of all sizes to make their products and services available to a
global marketplace. This is accomplished through a set of comprehensive and open
standards based on XML. The use of open standards built on Internet technologies lowers
the barriers to entry to achieve ubiquitous support. Businesses can discover and negotiate
agreements with trading partners automatically and then exchange documents in a secure,
reliable manner.
Overview of WSDL
Web Service Description Language (WSDL) is an XML language that contains
information about the interface, semantics and "administrivia" of a call to a Web service.
Once you have developed a Web service, you publish its description and a link to it in a
UDDI (Universal Description, Discovery and Integration) repository so that potential
users can find it. When someone thinks they want to use your service, they request your
WSDL file in order to find out the location of the service, the function calls and how to
access them. Then they use this information in your WSDL file to form a SOAP (Simple
Object Access Protocol) request to your computer.
• The endpoint for the service (a URL) within the <service> element
<?xml version="1.0"?>
<definitions name="StockQuote"
targetNamespace=
"http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace=
http://example.com/stockquote.xsd
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol"
type="string"/>
</all>
</complexType>
</element>
<element name="TradePrice">
<complexType>
<all>
<element name="price" type="float"/>
</all>
</complexType>
</element>
</schema>
</types>
<message name="GetLastTradePriceInput">
<part name="body" element=
"xsd1:TradePriceRequest"/>
</message>
<message name="GetLastTradePriceOutput">
<part name="body" element="xsd1:TradePrice"/>
</message>
<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/>
<output message="tns:GetLastTradePriceOutput"/>
</operation>
</portType>
<binding name="StockQuoteSoapBinding"
type="tns:StockQuotePortType">
<soap:binding style="document"
transport=
"http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetLastTradePrice">
<soap:operation
soapAction=
"http://example.com/GetLastTradePrice"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="StockQuoteService">
<documentation>My first service</documentation>
<port name="StockQuotePort"
binding="tns:StockQuoteBinding">
<soap:address location=
"http://example.com/stockquote"/>
</port>
</service>
</definitions>