XPath and SOAP (Jaxen)

Using XPath with SOAP uses Jaxen to demonstrate how to frob SOAP stuff with XPath.

XPath is a language for addressing parts of an XML document, used most commonly by XSLT. There are various APIs for processing XPath. For the purposes of this article I will use the open source Jaxen API. Jaxen is a Java XPath engine that supports many XML parsing APIs, such as SAX, DOM4J, and DOM. It also supports namespaces, variables, and functions.

XPath is useful when you need to extract some information from an XML document, such as a SOAP message, without building a complete parser using JAXM (Java API for XML Messaging) or JAX-RPC (Java API for XML-Based RPC). Moreover, the loosely-coupled nature of web services suggests that the use of dynamic data extraction is sometimes better than using static proxies like the ones produced using JAX-RPC.

In the article I'll show a JAXM Web Service for calculating statistics and a generic JAXM client that uses the service, demonstrating the use of XPath for generic data extraction.

About this Entry

This page contains a single entry by bob published on September 26, 2003 11:04 AM.

CM Geeks was the previous entry in this blog.

blogref is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.