XML News from Friday, November 10, 2006

BEA has posted a maintenance release of JSR-181 Web Services Metadata for the Java Platform. The changes seem relatively minor.


IBM has published the second maintenance release of Java Specification Request 110, Java APIs for WSDL. This is actually a fairly major, functional update compared to most maintenance releases. Changes include

  1. Read WSDL from a DOM Element specifying the base URI via a WSDLLocator instead of a URI string. See new method WSDLReader.readWSDL(WSDLLocator, Element)
  2. Perform ‘clean up’ of a WSDLLocator object to release system resources and/or prepare it for reuse (e.g. close any open input streams). See new method WSDLLocator.close().
  3. Specify the WSDLFactory implementation class name via a property file located in /META-INF/services. This permits more fine-grained control than the existing system-wide means of specifying the class name, namely; as a JVM system property, via a property file in the JRE/lib directory or via an implementation-specific default. See Javadoc for the WSDLFactory.newInstance() method.
  4. Specify not only the WSDLFactory implementation class, but also the classloader used to load it. See new method WSDLFactory.newInstance(String, ClassLoader).
  5. ‘Flatten’ a WSDL import tree by returning all PortTypes, Bindings or Services declared in the top-level Definition and in any imported Definitions. See the new methods on the javax.wsdl.Definition interface getAllPortTypes(), getAllBindings() and getAllServices().
  6. Explicitly get operations with unnamed input or output messages by specifying the value “:none” for those search parameters (versus the existing API behaviour of specifying null to ignore input or output message name from the search criteria). See the new Javadoc for methods PortType.getOperation(String,String,String) and Binding.getBindingOperation(String,String,String).
  7. For every addXXX method in the JWSDL API ensure a corresponding removeXXX method exists. This will improve the programmatic modification of WSDL definitions.
  8. Relax the restrictions on the use of extensibility elements and attributes imposed by the W3C WSDL
  9. 1 schema (and enforced by JWSDL
  10. 1) and instead permit every WSDL element to be extensible by elements or attributes, as per the WS-I Basic Profile
  11. 1 requirements. This will enable JWSDL to support the new JAX-WS specification.
  12. SOAP 2.1 binding extensions. See the new package javax.wsdl.extensions.soap
  13. WSDLException.toString() changed so that it no longer prints the stack trace, but instead just returns the ‘short message’, as described for the Exception.toString() method in Java 1.4
  14. The minimum supported Java level is now Java 1.4. It was previously Java 1.2

Nokia and Sun have posted the public review draft of JSR-280 XML API for JavaTM ME . to the Java Community Process (JCP). This attempts to subset SAX, StAX, JAXP, and DOM to run in small devices. This strikes me as such as bad idea, it's hard to believe they're serious. If size is such a concern (and in small devices it is) then pick one API and stick with it; or design a new one. Don't try to pull out half of each. Including both SAX and StAX in particular really smells of design by committee. There's no need to force both on device vendors. Pick one and be done with it. Comments are due by November 13.


Sun has posted the maintenance review change log for JSR 222: Java Architecture for XML Binding 2. Changes appear quite large, beyond what I'd expect from a real maintenance draft. For example,

Today, it just takes too many lines to do a simple stuff with JAXB. One typical example is the following code for reading XML from a file:

  File in = new File("FamilyData.xml");
  JAXBContext jc = JAXBContext.newInstance("kgh.geneology.xml");
  Unmarshaller u = jc.createUnmarshaller();
  JAXBElement junk = (JAXBElement)u.unmarshal(fin);
  DataFile df = (DataFile) junk.getValue();

(and if you count exception handling, add at least 4 lines for that.) Think of the DataFile class as the top-level class generated by a schema compiler.

We need convenience methods that focus on typical simple use case.

Proposed Solution

Define the JAXB class and the unmarshal/marshal methods on them. Those methods generally look like this:

    public static <T> T unmarshal( SOMETHING xml, Class<T> type );
    public static void marshal( Object jaxbObject, SOMETHING xml );

These methods do not throw checked exceptions.

Comments are due by November 27.


IBM has posted the public review draft of JSR-106 XML Digital Encryption APIs. to the JCP. This is a Java API for W3C Recommendation, XML Encryption Syntax and Processing. Interestingly it is model-independent. A DOM reference implementation is planned, but it should be possible to also write implementations for XOM, JDOM, and so forth. At first glance, it seems overly complex, however. I do plan to eventually add XML signatures to XOM, but when and if I do, I expect I'll design my own simpler API.


Alan Ezust has uploaded the eighth pre-release of jEdit 4.3, an open source programmer's editor written in Java with extensive plug-in support and my preferred text editor on Windows and Unix. This release fixes bugs and cleans up the API.


Advanced Software Production Line has posted LibAxl 0.27, an open source (LGPL) XML parser for Linux written in ANSI C. It uses its own custom API rather than one of the standards. At first glance, it does not appear to have namespace support.


Sun has posted the second maintenance review change log for JSR 224: Java API for XML-Based Web Services 2. At first glance the changes appear to mostly be in the documentation, rather than substantive. Comments are due by November 27.