14.5. Using JDOM

After our JaxmClient requests either conference or division standings, and the JaxmStandingsServlet has built a reply using either SAX or DOM, the reply is received back in the JaxmClient. The JaxmClient will now use yet a third XML API, JDOM, to parse the result. JDOM, as the name implies, has far more in common with DOM than with SAX. We pick up the code in Listing 14.8 at the point immediately following our message passing, to which we receive a SOAPMessage called reply in return.

Listing 14.8. JDOM Code to Parse SOAP Reply
         //Optional; allow visual inspection
         try {
            reply.writeTo(System.out);
            System.out.println();
            System.out.flush();
         } catch (IOException e) {
            e.printStackTrace();
         }
         SOAPPart soap = reply.getSOAPPart();
						StreamSource ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.