Java Reference
In-Depth Information
such, I will not discuss it in more detail here, but if you ever hear the name again, you know what it
relates to.
soap
Another RPC‐based protocol that enables accessing objects over a network is called SOAP, and it
was designed as the successor of XML‐RPC (XML‐based RPC). SOAP is quite popular in “enter-
prise” environments as a method to access and provide web services.
SOAP stands for “Simple Object Access Protocol,” although the W3 standards body has dropped
the use of the name as an acronym in a recent revision of the standard in favor of just using
“SOAP” as is. While this protocol is easier to use than CORBA, it can be argued that it is still not
really. . . simple. Recall that the introduction stated that web service technologies are typically
separated into “heavyweight” and “lightweight” categories, and SOAP—like other RPC‐based tech-
nologies—is one of the former. The basic idea behind SOAP is to provide an XML‐based messaging
framework that's extensible (new features can be easily added), neutral (SOAP messages can travel
on top of HTTP and a variety of other protocols), and independent (can be used independently of
the programming language and architecture used). These aspects make SOAP very versatile, but
the standard is also slower and more verbose than other RPC standards, as XML messages can
grow large quickly. For example, the following code snippet shows a SOAP request to call a method
AddTwoNumbers , which is embedded inside an HTTP request:
POST /mathematicsService HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: *LENGTH*
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap=" http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle=" http://www.w3.org/2001/12/soap-encoding" >
<soap:Body xmlns:m=" http://www.example.org/mathematics">
<m:AddTwoNumbers>
<m:FirstNumber>3</m:FirstNumber >
<m:SecondNumber>6</m:SecondNumber>
</m:AddTwoNumbers>
</soap:Body>
</soap:Envelope>
And the server answers with the following reply:
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: *LENGTH*
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap=" http://www.w3.org/2001/12/soap-envelope"
 
Search WWH ::




Custom Search