Welcome!

Microservices Expo Authors: Elizabeth White, Pat Romanski, Liz McMillan, Derek Weeks, LeanTaaS Blog

Related Topics: Microservices Expo

Microservices Expo: Article

The Sun Rises on Web Services

The Sun Rises on Web Services

With Microsoft's .NET marketing campaign in full swing, Sun announced its Sun ONE (Open Net Environment) initiative in October of 2001. While J2EE provides a robust, scalable, and portable enterprise platform, until then it had been sorely lacking in the area of standardized support for Web services. As a part of the Sun ONE initiative, Sun has since released the Java XML Pack, a suite of Java APIs for working with XML.

Java XML Pack Basics
So what exactly is the Java XML Pack? From a Web services perspective, the Java XML Pack facilitates the development, publishing, locating, and invocation of XML services via the Java 2 Platform.

The Java XML Pack provides a truly extensible and flexible interface for deploying enterprise-services architectures and is designed to provide a core set of standardized Java APIs for building, deploying, and accessing XML applications - and, specifically, dynamic XML-enabled Web services. The Java XML Pack APIs constitute a standard set of abstract APIs that aren't tied to a particular implementation technology. Thus, as is true with the rest of the Java 2 Platform, developers can code their application to an API, and easily adapt to changes in the industry without the need to rework or recompile their application code. Developers are free to use any JAXP-compliant XML parser, JAXB-compliant schema mechanism, JAXM-compliant messaging provider, JAXR-compliant registry service, or JAX-RPC-compliant invocation mechanism.

Additionally, although SOAP, WSDL, and UDDI are the current technologies du jour, the industry landscape may very well shift to other technologies such as XP (the W3C spec) and ebXML. When this happens, a Java XML Pack-compliant implementation can be plugged into an existing Java XML Packenabled architecture, and your applications will instantly leverage the new technologies to accomplish the same business services as before. Let's see your .NET technology do that!

Architecture Overview
The JAX Pack technologies can be divided into two broad categories: those that deal with an XML document holistically, and those that deal with it from a procedural perspective.

Document-centric

  • Java API for XML Processing (JAXP) - processes XML documents using a JAXP-compliant XML parser
  • Java Architecture for XML Binding (JAXB) - provides a mapping between XML document elements and Java classes, allowing XML documents to be treated as native Java objects

Procedure-centric

  • Java API for XML Messaging (JAXM) - facilitates XML-based messaging via the Java programming language
  • Java API for XML Registries (JAXR) - offers a uniform mechanism for accessing business registries through Java
  • Java API for XML-based RPC (JAX-RPC) - facilitates XML-based RPC over the Internet, allowing XML-formatted parameters to be passed to remote services, and XML-formatted values returned

This combination of APIs capable of dealing with an XML document as a whole, and providing support for invoking procedures with XML, constitutes a powerful services framework for the Java platform.

Drilling Down
Now let's look at each of these five APIs in a little more detail:

1. JAXP - Processing XML
The Java API for XML Processing (JAXP) predates the rest of the Java XML Pack. It provides basic XML capabilities for the Java platform through a flexible, standards-based API. JAXP is namespace aware and provides support for parsing XML documents, as well as transforming them into other formats. From an architectural perspective, JAXP is designed from the ground up to provide optimum flexibility. It employs a pluggability layer allowing compliant XML parsers and XML processors to be substituted at runtime, as well as supporting multiple parsing paradigms.

When parsing an XML document, developers can use the JAXP API in conjunction with any JAXP-compliant parser to consume XML documents and extract the data inside them. Both SAX-based (event model) parsing, as well as DOM-based (tree model) parsing are supported. This allows developers to utilize whichever parsing paradigm best suits a particular application's requirements. The Simple API for XML (SAX) defines an event-based API that navigates element by element through an XML document, signaling events as particular XML constructs are identified. The Document Object Model (DOM) defines a set of interfaces for constructing an object representation of the parsed XML document, based on a tree data structure. With DOM, the entire document is parsed and the tree structure is stored in memory, allowing repeated, random access to the XML document data. With SAX, the XML data is only accessible when the parser reaches a given element; once it moves on to another element, knowledge of the previous element is lost. These differing parsing styles allow developers to select whichever method best meets the application's requirements. Should the application need to evolve and support a different style, such a change is streamlined via JAXP.

When transforming an XML document, developers can use the JAXP API in conjunction with any JAXP-compliant processor to consume the XML document and transform the data into the desired format (HTML, WML, XSL, or some other flavor of XML). Currently, the only transformation technology supported by JAXP is the eXtensible Stylesheet Language Transformations (XSLT). XSLT allows the definition of XSL stylesheets capable of transforming an XML document into any other textual format, markup language, or even foreign language, based upon template definitions.

The JAXP 1.2 reference implementation ships with two open-source components. The Crimson XML parser (which supports SAX and DOM) and the Xalan XSLT processor, both jointly developed by Sun and the Apache Software Foundation.

2. JAXB - XML Object Binding
The Java Architecture for XML Binding (JAXB) defines an XML-to-Java mapping architecture. It's a fast, efficient means of creating a two-way mapping between the elements in an XML document and Java classes. Given a DTD that defines the schema for the XML document, and a binding schema that defines how to bind the schema to classes, the JAXB compiler will generate a set of Java classes containing all the necessary code to parse XML documents based on the schema. These classes can be used to build a Java object tree representing an XML document that's valid for the schema. This object tree can be constructed by parsing an XML document, or by directly instantiating objects from the generated classes. JAXB can also be used to dynamically modify the element contents of the object tree, and it can marshal the object representation into an XML document based on the mapping defined within the binding schema. In this way, JAXB defines an architecture that provides a convenient, two-way mapping between Java and XML.

At first glance, it would appear that with the JAXB architecture there's no need for the JAXP API. Although there are some areas in which they overlap, they each have distinct features that make them more or less useful for certain tasks.

Table 1 summarizes the differences between the two technologies. For starters, JAXP provides a one-stop shop for parsing, processing, and transforming XML documents. You can select SAX for high-performance, one-time processing, or when you only want a portion of a very large document. You can select DOM when you need to maintain an in-memory representation of an XML document. The DOM API will even allow you to modify the structure and content of an object tree. JAXP also provides a transformer API to convert a document from one format to another. From a validation perspective, JAXP can use a previously known schema, or accept a new one dynamically at runtime. This validation paradigm, although a bit costly, is incredibly flexible.

JAXP provides all these features from the convenience of a single API. JAXB provides some similar features and some unique features. JAXB uses a custom parsing mechanism that builds an in-memory object representation like DOM, but is about as fast as SAX parsing. This is because the generated classes contain all the necessary DTD logic, whereas SAX parsers must accommodate a dynamic validation check against a schema. Additionally, the in-memory object tree created and maintained by a JAXB application has a considerably smaller footprint, because, unlike JAXP, it doesn't contain tree manipulation logic. Developers can certainly modify the object properties (which correspond to element values in XML), but JAXB doesn't facilitate the manipulation of the structure of the object tree (adding and removing elements). One additional aspect of JAXB is that a schema is required and only valid XML will be processed by the application. Whether this is a restriction or a feature depends entirely on your application's requirements.

JAXB provides a bridge between the language-neutral world of XML and the platform-neutral world of Java. In the same way that an XML document is an instance of aschema, a Java object is an instance of a class. As Sun's whitepaper, Web Services Made Easier explains it: "Thus, JAXB allows you to create Java objects at the same conceptual level as the XML data." Java developers are comfortable with object-based relationships, encapsulation, and the level of granularity that objects provide. JAXB provides a fast, convenient mechanism to access XML in this same manner.

3. JAXM - XML Messaging
The Java API for XML Messaging (JAXM), is a full-featured asynchronous messaging technology, representing a standard way to send messages across a network from the Java platform. It's decoupled from the underlying protocol(s) being used, affording developers a standardized messaging API that won't have to be changed to accommodate a different underlying protocol. JAXM is currently based on the SOAP 1.1 and SOAP with Attachments specifications, but it can be extended to work with higher level protocols such as ebXML or bizTalk, or any other protocol that the industry - or a particular business partner - chooses to embrace at a later time.

JAXM messaging requires the use of a messaging provider service, which handles the transportation, routing, marshalling and unmarshalling work that goes on under the hood. The JAXM API shields developers from such details, and provides a clean and simple interface for sending messages, receiving messages, or simply taking part in the processing of a portion of a message (serving as a message intermediate). The messaging provider can offer additional functionality, such as guaranteed messaging, event logging and auditing, message threading, and even security. All such activity is shielded from the sender, receiver, or any participant in a messaging exchange. All that's required is that the JAXM client make method calls against the API. This decoupling allows messaging providers to offer value-added features and allows application developers the freedom to select the provider that best meets their needs. It may be helpful to think of JAXM in the messaging space as being equivalent to what JDBC provides in the database access space. In this analogy, a messaging provider serves a similar purpose as a JDBC driver. Developers write their application code to the API, and vendors develop software components that provide concrete implementations of the API. The primary difference here is that, while JDBC requires that you use a driver that is compatible with the database being used, the messages sent from a JAXM messaging provider conform to industry standards, and can be consumed by any recipient that understands those standards. The JAXM reference implementation uses SOAP 1.1, thus any SOAP-enabled recipient would be able to unmarshal a message sent from it

JAXM is a robust messaging technology supporting a wide-variety of messaging paradigms, including point-to-point messaging, publish-subscribe messaging, intermediate point-to-point, request-response, and even a process-workflow messaging model. (That's not a comprehensive list by any means.) Which specific messaging paradigms are available is entirely dependent on the messaging provider used, but JAXM provides a standard means of defining how a message should be sent and what auxiliary information may need to be passed in order to process the message properly.

In many ways, JAXM is very similar to the Java Messaging Service (JMS). They both provide an abstract messaging API that's decoupled from the back end implementation, and they both require a messaging provider to implement the API. In fact, the current JMS-compliant messaging providers are likely to be the first vendors to incorporate support for JAXM into their tools. The difference, then, between JAXM and JMS, is that JMS ultimately produces a Java-centric message. Whereas JAXM messages comply with industry-standard formats such as SOAP and ebXML.

4. JAXR - Registering/Locating XML Services
The Java API for XML Registries (JAXR) provides a registry independent API for accessing XML-based registries. A registry is very much like the yellow pages, or the listings maintained by a search engine. It provides a convenient means to browse available services, gather information regarding those services and then select the desired service. Like search engines, registries support the ability to return a list of search results based upon specified criteria. Like the yellow pages, registries categorize their contents and allow clients to browse by category. In addition to providing the ability to search such registries and retrieve details about available XML services, JAXR enables developers to publish new services to the registry and even to manage the registry data itself (assuming that proper authentication is provided first).

Although the majority of the literature talking about service registries discuss as the concept of global public registries like Xmethods.com, UDDI.org, and the registries of IBM, Microsoft, and HP a far more immediate use for service registries can be found in intranet and extranet registries. It's unlikely, any time in the near future, that consumers will query public registries trying to find the best deal on their auto insurance, or that businesses will start browsing public registries looking for a service to fill a mission critical need. A much more likely scenario is that businesses may set up private registries to serve as a single point of reference for their various enterprise services. Rather than an application developer combing through outdated documentation, or waiting for a response to a request they sent to management regarding a particular service they need to access, they can simply browse the company's internal registry looking for the service. If they can't find one, the developer can be reasonably sure that one doesn't exist. This tremendously increases the productivity of that developer and of everyone else that might have occasion to locate and/or access the available enterprise services. A similar need can be met with registries in a B2B extranet scenario. A business can expose a private registry to its business partners, providing them with a comprehensive, standards-based mechanism for searching, locating, inquiring about, and binding to whatever services the business has made available. The business could even allow the partner to register new services that would now become available for the business to access.

There are currently two primary specifications for XML registries:

  • The ebXML Registry and Repository standard being jointly developed by OASIS and the UN
  • The Universal Description, Discovery, and Integration (UDDI) specification being developed by a consortium of over 100 companies.

As is the case with the other Java XML Pack technologies, JAXR represents a flexible mechanism that's not tied to any particular implementation. Thus the same application code can be used for accessing first a UDDI registry, then an ebXML registry. The JAXR 1.0 Early Access Reference Implementation supports both the ebXML registry and the UDDI Registry v2.0 specification. Sun intends to incorporate support for ebXML as that standard is finalized.

5. JAX-RPC - XML-based RPC
The Java API for XML-based RPC (JAX-RPC) gives Java developers a simple, convenient mechanism for invoking remote procedures in a neutral, standards-based way. JAX-RPC is a synchronous, pure Java, RPC-invocation mechanism that leverages standard XML protocols such as SOAP. It's pure Java in that it doesn't require the existence of an XML schema or a messaging provider in order to make a remote call.

JAX-RPC provides a simple, object-oriented mechanism for specifying the service location, parameter types and values for a service. As with other RPC mechanisms, a JAX-RPC client simply creates a local object, propagates it with the necessary information, then invokes methods directly on the local object. When the call is made, JAX-RPC marshals the call across the network (as a SOAP message), and unmarshals the response (converts the SOAP response to a Java object). The details of the mapping and reverse mapping of data types and other XML element constructs are abstracted away from the JAX-RPC application developer. Thus, it provides a simple, straightforward mechanism for accessing RPC-style Web services from the Java platform.

As with any RPC mechanism, an interface for the remote procedure needs to be generated, along with stubs and ties. The JAX-RPC reference implementation accordingly ships with a stub and tie generation tool, xrpcc. Given an appropriate interface, the xrpcc tool generates stubs, ties, and a server configuration file. The tool supports both standard Java RMI interfaces and WSDL documents. In addition to generating the appropriate files to set up the RPC-runtime, the tool can also convert a set of Java RMI interfaces into a WSDL document and vice versa.

Like JAXM, JAX-RPC is a tremendous client technology for accessing Web services. Not only does it leverage Java's platform independency, allowing the client to be run on any Java 2 platform, but the ac-cess mechanism used by JAX-RPC is SOAP, an inherently language and plat-form neutral communication protocol. This provides the optimum in RPC-flexibility and portability.

Conclusion
The Java APIs and architectures for XML provide a comprehensive suite of XML APIs for the Java platform. JAXP allows developers a flexible means to parse, process and transform XML documents; JAXB defines a two-way mapping architecture between XML and Java; JAXM is a robust asynchronous messaging technology; JAXR provides standardized access to XML registries, and JAX-RPC enables RPC-style invocation of XML Web services.

Just as JDBC has become an expected acronym to see on a Java developer's resumé, the JAX technologies are sure to become a required part of any Web or enterprise developer's toolkit.

Exploring Further
You can download the pack from Sun's Web site at http://java.sun.com/xml/javaxmlpack.html and take it for a spin. Sun recently released the Java XML Pack as a part of the Java Web Services Developer Pack (Java WSDP) which is available for download at http://java.sun.com/webservices/webservicespack.html A tutorial for the WSDP is available at http://java.sun.com/webservices/docs/ea1/tutorial/index.html

More Stories By Kyle Gabhart

Kyle Gabhart is a subject matter expert specializing in strategic planning and tactical delivery of enterprise technology solutions, blending EA, BPM, SOA, Cloud Computing, and other emerging technologies. Kyle currently serves as a director for Web Age Solutions, a premier provider of technology education and mentoring. Since 2001 he has contributed extensively to the IT community as an author, speaker, consultant, and open source contributor.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@MicroservicesExpo Stories
"I focus on what we are calling CAST Highlight, which is our SaaS application portfolio analysis tool. It is an extremely lightweight tool that can integrate with pretty much any build process right now," explained Andrew Siegmund, Application Migration Specialist for CAST, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...
As many know, the first generation of Cloud Management Platform (CMP) solutions were designed for managing virtual infrastructure (IaaS) and traditional applications. But that's no longer enough to satisfy evolving and complex business requirements. In his session at 21st Cloud Expo, Scott Davis, Embotics CTO, explored how next-generation CMPs ensure organizations can manage cloud-native and microservice-based application architectures, while also facilitating agile DevOps methodology. He expla...
DevOps promotes continuous improvement through a culture of collaboration. But in real terms, how do you: Integrate activities across diverse teams and services? Make objective decisions with system-wide visibility? Use feedback loops to enable learning and improvement? With technology insights and real-world examples, in his general session at @DevOpsSummit, at 21st Cloud Expo, Andi Mann, Chief Technology Advocate at Splunk, explored how leading organizations use data-driven DevOps to close th...
"WineSOFT is a software company making proxy server software, which is widely used in the telecommunication industry or the content delivery networks or e-commerce," explained Jonathan Ahn, COO of WineSOFT, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Some people are directors, managers, and administrators. Others are disrupters. Eddie Webb (@edwardawebb) is an IT Disrupter for Software Development Platforms at Liberty Mutual and was a presenter at the 2016 All Day DevOps conference. His talk, Organically DevOps: Building Quality and Security into the Software Supply Chain at Liberty Mutual, looked at Liberty Mutual's transformation to Continuous Integration, Continuous Delivery, and DevOps. For a large, heavily regulated industry, this task ...
The notion of improving operational efficiency is conspicuously absent from the healthcare debate - neither Obamacare nor the newly proposed GOP plan discusses the impact that a step-function improvement in efficiency could have on access to healthcare (through more capacity), quality of healthcare services (through reduced wait times for patients) or cost (through better utilization of scarce, expensive assets).
The past few years have seen a huge increase in the amount of critical IT services that companies outsource to SaaS/IaaS/PaaS providers, be it security, storage, monitoring, or operations. Of course, along with any outsourcing to a service provider comes a Service Level Agreement (SLA) to ensure that the vendor is held financially responsible for any lapses in their service which affect the customer’s end users, and ultimately, their bottom line. SLAs can be very tricky to manage for a number ...
The dynamic nature of the cloud means that change is a constant when it comes to modern cloud-based infrastructure. Delivering modern applications to end users, therefore, is a constantly shifting challenge. Delivery automation helps IT Ops teams ensure that apps are providing an optimal end user experience over hybrid-cloud and multi-cloud environments, no matter what the current state of the infrastructure is. To employ a delivery automation strategy that reflects your business rules, making r...
Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the bene...
The past few years have brought a sea change in the way applications are architected, developed, and consumed—increasing both the complexity of testing and the business impact of software failures. How can software testing professionals keep pace with modern application delivery, given the trends that impact both architectures (cloud, microservices, and APIs) and processes (DevOps, agile, and continuous delivery)? This is where continuous testing comes in. D
In a recent post, titled “10 Surprising Facts About Cloud Computing and What It Really Is”, Zac Johnson highlighted some interesting facts about cloud computing in the SMB marketplace: Cloud Computing is up to 40 times more cost-effective for an SMB, compared to running its own IT system. 94% of SMBs have experienced security benefits in the cloud that they didn’t have with their on-premises service
There is a huge demand for responsive, real-time mobile and web experiences, but current architectural patterns do not easily accommodate applications that respond to events in real time. Common solutions using message queues or HTTP long-polling quickly lead to resiliency, scalability and development velocity challenges. In his session at 21st Cloud Expo, Ryland Degnan, a Senior Software Engineer on the Netflix Edge Platform team, will discuss how by leveraging a reactive stream-based protocol,...
Admiral Calcote - also known as Lee Calcote (@lcalcote) or the Ginger Geek to his friends - gave a presentation entitled Characterizing and Contrasting Container Orchestrators at the 2016 All Day DevOps conference. Okay, he isn't really an admiral - nor does anyone call him that - but he used the title admiral to describe what container orchestrators do, relating it to an admiral directing a fleet of container ships. You could also say that they are like the conductor of an orchestra, directing...
Our work, both with clients and with tools, has lead us to wonder how it is that organizations are handling compliance issues in the cloud. The big cloud vendors offer compliance for their infrastructure, but the shared responsibility model requires that you take certain steps to meet compliance requirements. Which lead us to start poking around a little more. We wanted to get a picture of what was available, and how it was being used. There is a lot of fluidity in this space, as in all things c...
The goal of Microservices is to improve software delivery speed and increase system safety as scale increases. Microservices being modular these are faster to change and enables an evolutionary architecture where systems can change, as the business needs change. Microservices can scale elastically and by being service oriented can enable APIs natively. Microservices also reduce implementation and release cycle time and enables continuous delivery. This paper provides a logical overview of the Mi...
Gaining visibility in today’s sprawling cloud infrastructure is complex and laborious, involving drilling down into tools offered by various cloud services providers. Enterprise IT organizations need smarter and effective tools at their disposal in order to address this pertinent problem. Gaining a 360 - degree view of the cloud costs requires collection and analysis of the cost data across all cloud infrastructures used inside an enterprise.
"We started a Master of Science in business analytics - that's the hot topic. We serve the business community around San Francisco so we educate the working professionals and this is where they all want to be," explained Judy Lee, Associate Professor and Department Chair at Golden Gate University, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Gone are the days when application development was the daunting task of the highly skilled developers backed with strong IT skills, low code application development has democratized app development and empowered a new generation of citizen developers. There was a time when app development was in the domain of people with complex coding and technical skills. We called these people by various names like programmers, coders, techies, and they usually worked in a world oblivious of the everyday pri...
The “Digital Era” is forcing us to engage with new methods to build, operate and maintain applications. This transformation also implies an evolution to more and more intelligent applications to better engage with the customers, while creating significant market differentiators. In both cases, the cloud has become a key enabler to embrace this digital revolution. So, moving to the cloud is no longer the question; the new questions are HOW and WHEN. To make this equation even more complex, most ...