Download Java API for XML Registries _JAXR_

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Java API for XML Registries
(JAXR)
by Michael Knecht (Matrikelnr. 578215)
JavaTM API for XML Registries (JAXR)
Term Definition.......................................................................................... 3
General Overview ...................................................................................... 5
Registry standards ...................................................................................... 6
UDDI (Universal Description, Discovery, and Integration) ............................6
ebXML (electronic business XML )..............................................................6
API Overview............................................................................................. 7
Architecture ................................................................................................ 8
Overview.....................................................................................................8
JAXR Client ................................................................................................8
Interface Connection & Interface RegistryService.........................................9
The JAXR Provider......................................................................................9
JAXR Pluggable provider ........................................................................9
registry-specific JAXR.............................................................................9
Registry Provider .......................................................................................10
Benefits of JAXR Architecture...............................................................10
JAXR Interaction steps............................................................................11
JAXR provider .........................................................................................11
javax.xml.registry ......................................................................................12
javax.xml.registry.infomodel......................................................................12
JAXR Exception handling ..........................................................................12
Relationship to other Java APIs..............................................................13
JAXP ........................................................................................................13
JAXB........................................................................................................13
JAX-RPC ..................................................................................................13
JAXM .......................................................................................................13
Code examples .........................................................................................14
PublishORG.java .......................................................................................14
ISOQuery.java...........................................................................................14
JAXR related resources on the internet .................................................15
Term Definition
Term
Definition
registry
Most business-to-business (B2B)
interactions are based on a
collaborative process between 2 parties
that are engaged in a partnership. A
registry is a neutral 3rd party that helps
facilitate such collaboration. A registry
is available to organizations as a shared
resource often in the form of a web
based service.
A registry is a key component in any
Web Services architecture because it
provides organizations with the ability
to publish, discover and utilize web
services. Registries enable dynamic
and loosely coupled B2B collaboration.
registry provider
implementations of business
registries conforming to various
registry specifications and emerging
standards
JAXR provider
implementations of the JAXR
API, a JAXR provider provides access
to a specific registry provider or to a
class of registry providers that are
based on a common specification
JAXR client
client programs that access business
registries using the JAXR API
repository item
refer to actual content (e.g. an XML
Schema document, as opposed to
metadata about the XML Schema
document) submitted to a registry. The
term “repository item instance” is used
to refer to a single instance of some
repository item
registry object
refer to metadata that catalogs or
describes a repository item. It is
reflected by the RegistryObject
interface in the JAXR information
model and its sub-interfaces
General Overview
The Java API for XML Registries (JAXR) provides a convenient way to access
standard business registries over the Internet. Business registries are often
described as electronic yellow pages because they contain listings of businesses
and the products or services the businesses offer. Registries facilitate the
creation of business relationships by providing an independent online
information exchange service that allows service providers (e.g. sellers) to
advertise their products and services, and service consumers (e.g. buyers) to
discover these products and services.
JAXR gives developers writing applications in the Java programming language
a uniform way to use business registries that are based on open standards (such
as ebXML) or industry consortium-led specifications (such as UDDI).
Businesses can register themselves with a registry or discover other businesses
with which they might want to do business. In addition, they can submit material
to be shared and search for material that others have submitted. Standards
groups have developed DTDs for particular kinds of XML documents, and two
businesses might, for example, agree to use the DTD for their industry’s
standard purchase order form.
Because the DTD is stored in a standard business registry, both parties can use
JAXR to access it.
Registries are becoming an increasingly important component of web services
because they allow businesses to collaborate with each other dynamically in a
loosely coupled way. Accordingly, the need for JAXR, which enables
enterprises to access standard business registries from the Java programming
language, is also growing.
Registry standards
UDDI (Universal Description, Discovery, and Integration)
UDDI can be considered as a telephone book with white, yellow and green
pages.
Figure 1: UDDI structure
The UDDI specification defines how Web Services can be published und found
in UDDI Business Registries.
These specifications are based upon XML data structures and SOAP
communication APIs.
ebXML (electronic business XML )
ebXML can be considered as a cheap alternative to EDI (Electronic Data
Interchange). It is based upon XML and usable over the internet.
It defines electronic business including the communication specification and the
profiles of business partners.
It is separated in registry und repository. The registry references to data, the
repository saves data.
API Overview
The Java API for XML Registries (JAXR) provides a uniform and standard Java
API for accessing different kinds of XML Registries. An XML registry is an
enabling infrastructure for building, deploying, and discovering Web services.
Currently there are a variety of specifications for XML registries including, preeminently, the ebXML Registry and Repository standard, which is being
developed by OASIS and U.N./CEFACT and the UDDI specification, which is
being developed by a vendor consortium.
JAXR enables Java software programmers to use a single, easy-to-use
abstraction API to access a variety of XML registries. Simplicity and ease of use
are facilitated within JAXR by a unified JAXR information model, which
describes content and metadata within XML registries.
JAXR provides rich metadata capabilities for classification and association, as
well as rich query capabilities. As an abstraction-based API, JAXR gives
developers the ability to write registry client programs that are portable across
different target registries. This is consistent with the Java philosophy of Write
Once, Run Anywhere. Similarly, JAXR also enables value-added capabilities
beyond those of the underlying registries.
The actual version of the JAXR specification (version 1.0) includes detailed
bindings between the JAXR information model and both the ebXML Registry
and the UDDI Registry v2.0 specifications.
JAXR works in synergy with related Java APIs for XML, such as Java API for
XML Processing (JAXP), Java Architecture for XML Binding (JAXB), Java
API for XML-based RPC (JAX-RPC), and Java API for XML Messaging
(JAXM), to enable web services within the Java 2 Platform, Enterprise Edition
(J2EE).
Figure 2: Interoperability between diverse JAXR clients and diverse registries
Architecture
Overview
Figure 3 JAXR Architecture
The circles represent the various interfaces implemented by the JAXR client and
the JAXR provider:
- RS represents the RegistryService interface implemented by the JAXR
provider.
- C1, C2 through Cn represent the JAXR interfaces implemented by the
JAXR provider that provide the various registry capabilities.
JAXR Client
The JAXR client may be any standalone
Java application or an enterprise
component based on J2EE technology.
The JAXR client uses the JAXR API to
access a registry via a JAXR provider.
Interface Connection & Interface RegistryService
A client must create a JAXR Connection
to a registry provider using an appropriate
JAXR provider in order to employ the
services of that registry using
the JAXR API.
The RegistryService interface is the principal interface implemented by a JAXR
provider. A registry client can get this interface from its connection to a JAXR
provider.
The RegistryService interface provides the getter methods that are used by the
client to discover various capability-specific interfaces implemented by the
JAXR provider. It also provides a getCapabilityProfile method that allows the
JAXR client to access the capability profile that describes the capabilities
supported by the JAXR provider.
The JAXR Provider
The JAXR provider is an implementation
of the JAXR API.
A JAXR client accesses a registry via a
JAXR provider.
JAXR Pluggable provider
The JAXR Pluggable provider implements features of the JAXR API that are
independent of any specific registry type.
registry-specific JAXR
The registry-specific JAXR providers implement the JAXR API in a registryspecific manner. A registry-specific JAXR provider plugs into the JAXR
Pluggable provider and is used by the JAXR Pluggable provider in a delegation
pattern.
Registry Provider
These are implementations of various
registry specifications such as ebXML
and UDDI.
Benefits of JAXR Architecture
1. If a new registry standard is developed, it can be included in the JAXR
provider implementation without having to change the JAXR client.
2. A JAXR client is capable to communicate with several registries in one
session.
3. Additional capability profiles allow the limitation or expansion of the
functionality of a JAXR provider.
JAXR Interaction steps
1. JAXR Client sends a request
A JAXR Client uses JAXR interfaces and classes
to access a registry. The client sends the request
to a JAXR Provider.
2. When a JAXR Provider receives a request from
a JAXR client, he transforms the request into an
equivalent request, which is based upon the
specification of the target registry. The JAXR
provider now sends this request to a registry
provider.
3. The registry provider receives the request from
the JAXR provider and processes it.
4. The registry provider sends a reply to the JAXR
provider which is transformed into a JAXR
reply.
5. The JAXR provider sends the JAXR reply to the
JAXR client.
JAXR provider
The JAXR provider implements two main packages:
- javax.xml.registry
This package includes API interfaces and classes which define interfaces
for accessing the registry.
-
javax.xml.registry.infomodel
This package includes interfaces which define the JAXR information
model.
javax.xml.registry
The javax.xml.registry packet has the following basic interfaces:
- Connection
The client needs to establish a connection to the JAXR Provider in order
to use the registry. The connection represents a client session with a
registry provider.
- RegistryService
The client receives a RegistryService object from his connection.
Furthermore the RegistryService provides other interfaces to the client for
accessing the registry.
The javax.xml.registry packet has the following primary interfaces:
- BusinessQueryManager
This interface allows the client to search the registry for
information.BusinessLifeCycleManager
This interface allows the client to modify information in a registry
through saving or deleting.
- DeclarativeQueryManager
This interface enables the use of SQL syntax in queries for the client (not
implemented at the moment).
javax.xml.registry.infomodel
The registry javax.xml.registry.infomodel contains the interfaces which define
the JAXR information modelThese interfaces define the types of objects in a
registry and their relations. The elemental interfaces in this package is the
RegistryObject interface with the subinterfaces Organization, Service and
ServiceBinding.
JAXR Exception handling
If an error occurs a JAXR API method or one of its subclasses is called.
Some methods in the JAXR API use a collection as argument or return value.
This enables the parallel use of several registry objects.
Relationship to other Java APIs
JAXR is related to several other Java APIs for XML. In future, these APIs may
become part of the Java 2 Platform, Enterprise Edition (J2EETM platform).
JAXP
Java API for XML Processing or JAXP enables flexible XML processing from
within Java programs. The JAXR API will make direct XML processing less
important for JAXR clients. However, JAXP may be used by implementers of
JAXR providers and JAXR clients for processing XML content that is submitted
to or retrieved from the registry. The JAXP API is likely to also be used in
implementations of the JAXB API described next.
JAXB
Java API for XML Binding or JAXB enables simplified XML processing using
Java classes that are generated from XML schemas. The JAXR API will make
direct XML processing less important for JAXR clients.
However, JAXB may be used by implementers of JAXR providers and JAXR
clients for processing XML content that is submitted to or retrieved from the
registry.
JAX-RPC
Java API for XML-based RPC or JAX-RPC provides an API for XML-based
RPC communication in the Java platform.
Implementations of the JAXR providers may use JAX-RPC for communication
between JAXR providers and registry providers that export a SOAP-based RPC
like interface (e.g. UDDI).
JAXM
Java API for XML Messaging or JAXM provides an API for packaging and
transporting of message based business transactions using on-the-wire protocols
defined by emerging standards.
Implementations of the JAXR providers may use JAXM for communication
between JAXR providers and registry providers that export an XML Messaging
based interface (e.g. ebXML TRP).
Code examples
The attached code examples (commented in german) consist of two java files:
PublishORG.java
The PublishORG class consists of a main method, a makeConnection method,
and an executePublish method.
It creates an organization and publishes it to a registry.
ISOQuery.java
The ISOQuery class consists of a main method, a makeConnection method, an
executeQuery method.
It searches a registry for information about organizations using ISO
classification.
JAXR related resources on the internet
The official JAXR Website at java.sun.com:
http://java.sun.com/xml/jaxr/
The official JAXR Downloads at java.sun.com:
http://java.sun.com/xml/downloads/jaxr.html
An in-depth look at JAXR by Frank Sommers
http://www.javaworld.com/javaworld/jw-05-2002/jw-0517-webservices.html
JAXR: a Web Services Building Block by Sameer Tyagi
http://www.fawcette.com/javapro/2002_10/magazine/features/styagi/
Understanding UDDI and JAXR by Satya Komatineni
http://www.onjava.com/pub/a/onjava/2002/02/27/uddi.html
Java Web service tutorial part 3: JAXR by iX magazine (in German)
http://www.heise.de/ix/artikel/2002/11/140/