Chapter 3. Working with XML and Java

Introduction

This chapter provides some useful techniques for handling XML data in a variety of ways that are important specifically in the context of building out your SOA. We’ll also examine some relatively new ways of working with XML as provided by the latest Java APIs. As Java programmers, we’ve been processing XML in a variety of ways for several years, so I’m going to forego the basics there. I assume that you’ve worked with SAX and DOM before, so we can get right to the new stuff. Finally, this chapter aims to illustrate how to effectively use XML and data binding specifically within an SOA.

It is not a given, however, that every architect will design an SOA around XML. If you have decided that all your services will be implemented in straight Java using EJBs or RMI, that’s fine too. But using XML as your mode of message exchange is a very popular approach, and for good reason. SOA is about flexible integration. And while legacy data may live in a variety of formats, if you can get it into XML, you can move it anywhere else, transform it, and give it new life. In this way, XML supports what is, in my view, the core message of SOA: embrace difference. Midrange iSeries computers from IBM whose day job is running 20-year-old COBOL programs now come with SAX parsers out of the box. Native XML databases such as Xindice and Berkeley XML DB are gaining modest popularity. In support of SQL 2003, Microsoft SQL Server, Oracle, and JDBC 4.0 treat ...

Get Java SOA Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.