Java Reference
In-Depth Information
soap:encodingStyle=" http://www.w3.org/2001/12/soap-encoding" >
<soap:Body xmlns:m=" http://www.example.org/mathematics">
<m:AddTwoNumbersResult>
<m:Result>9</m:Result>
</m:AddTwoNumbersResult>
</soap:Body>
</soap:Envelope>
As you can see from this example, XML—just like HTML—is another markup language that's used
to encode documents in a format that is both human‐ and machine‐readable. It is similar to HTML
in the sense that documents are formatted as a tree of tags. For example, the following XML docu-
ment describes a simple book listing:
<?xml version="1.0"?>
<books>
<book>
<title>My First Book</title>
<authors>
<author>
<firstname>Anton</firstname>
<lastname>Anonymous</lastname>
</author>
</authors>
</book>
<book>
<title>Another Book</title>
<authors>
<author>
<firstname>Anton</firstname>
<lastname>Anonymous</lastname>
</author>
<author>
<firstname>Bruce</firstname>
<lastname>McAuthor</lastname>
</author>
</authors>
</book>
</books>
SOAP is often combined with another standard, called WSDL (Web Services Description Language).
WSDL is used to describe the functionalities offered by the web service. You will see more about
WSDL later, when you learn how to access SOAP services with Java.
Java provides excellent functionalities to communicate with SOAP services, as you will see later.
However, the verbosity and “heaviness” of this technique have caused a shift toward simpler proto-
cols in recent years. Traditionally, the Java ecosystem has always been very “XML friendly,” with
many messaging formats and configuration files being defined and stored as XML. In recent years,
especially with the rise of “modern” web frameworks such as Ruby on Rails, a shift has been occur-
ring toward simpler architectures, which prefer to use simpler data description languages such as
JSON or YAML. For example, here is how the “books” data structure as provided in the previous
Search WWH ::




Custom Search