Custom Protocols

XML-RPC is vastly underpowered for many tasks (for example, any that require strings in a language other than English), whereas SOAP is perhaps overcomplicated for many jobs. There is, however, a convenient middle ground. The truly key idea for both SOAP and XML-RPC is that you can pass an XML document over the Web using HTTP POST. The exact format of that data doesn't really matter much, as long as both client and server agree on what it is and what it means.

For example, if an online broker such as Ameritrade wanted to provide its clients specialized trading software, it could use any XML format it wanted to send the data back and forth. It might choose to ignore the SOAP envelope completely and just send the getQuote and ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX 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.