Working with Literal XML Documents
In addition to JavaBeans, Apache SOAP also supports the passing of literal XML documents. Our third example demonstrates the main concepts. The client code will send a product query by sending a product element with a SKU attribute. For example:
<product sku="A358185"/>
The server will respond with a complete product XML document. For example, the following command line:
java com.ecerami.soap.ProductXMLClient A358185
will generate this XML response:
<product sku="A358185"> <name>Red Hat Linux</name> <description>Red Hat Linux Operating System</description> <price>54.99</price> </product>
Working with literal XML documents requires some knowledge of the XML Document Object Model (DOM) API. Even if you are not familiar with the DOM API, however, you should be able to follow the general flow of the example code.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access