Java Reference
In-Depth Information
systems can easily wrap their documents in XML for external representation to busi-
ness partners. The business partners can either process the documents directly or first
convert the documents into a format suitable for a legacy EDI system.
O NLINE XML OR W EB S ERVICES
The use of XML is not restricted to batch operations. Real-time interfaces to systems
necessarily define data structures. Often, these structures must be self-describing for
a variety of reasons.
For example, suppose you have a real-time interface that performs some service
on behalf of a client application. This service must support several client applica-
tions simultaneously. Suppose further that the interface specification needs to in-
clude additional data elements in order to support some new requirement. Not all
client systems can be updated simultaneously; in fact, it is likely that at least some
older client systems need to be supported for a year or more.
One traditional solution for this requirement is to include a version identifier in
the interface structure. The real-time service module can examine the version of a
particular message and respond to either the new or the old type of message. (In this
situation, you are well advised to normalize either message type into some standard
internal structure rather than actually leaving the original code as is. Otherwise,
there will be two versions of the service module to maintain.)
An XML-based real-time interface specification is a perfect choice for this sit-
uation. Each client service request that is based on XML will be self-describing. The
service module can extract the data that is actually in a particular message, perhaps
providing defaults for data that is not present in the message. The service module
can respond with an XML-based return message containing either the new or the
old data set. A client application can extract the information it requires from the re-
sponse. An even more sophisticated solution would allow the client application to
pass in an initial XSD or DTD at runtime. This XSD would define the structure of
the request and response method that the client can accept.
These advantages work for the client application as well. Client applications
that use XML-based messages when talking to services can talk to new and old ser-
vices simultaneously. The structure of the messages is not tied to the various ver-
sions of the services, only the message content is. This greatly simplifies the coding
required to support multiple versions of service modules talking to multiple ver-
sions of clients.
XML is also an excellent infrastructure for interactive messages between sys-
tems. For example, an online procurement system might send an XML-based cat-
alog query to a supplier's system. The supplier's system could reply with catalog
Search WWH ::




Custom Search