Java Reference
In-Depth Information
might generate dynamic HTML content for display as a web page, but there
certainly is no requirement to do so. In a web services distributed computing
application, the servlet might very well reply to the server with another XML
document containing the results of the calculation. No web browser and no human
may ever see the output.
21.4.3
t )asaweb service
In practice, of course, the calculations are being done for the benefit of some
humans somewhere. We could, for example, implement the sin (
Sin (
ω
t ) calculation
of Chapter 20 as a web service. The client would be much the same, except it
would send data to the remote servlet as the XML payload of a HTTP GET or
POST rather than in an RMI remote method call. Part of that payload would
include the name of the function to perform - initialize , receiveInput ,
or retrieveData . The servlet would use some XML parser to read the input
data and perform the calculations. The servlet would also use XML tools to
package the results as a reply XML document to be sent back to the client.
The client would still use its graphical interface to plot the results for human
consumption. Note that no web browser entered the discussion above at all. We
simply used XML and the technology behind the Web - i.e. HTTP - to com-
municate between a client and a server, which, in this case, is implemented as a
Java servlet.
ω
21.4.4 Web services for scientific applications
The astute reader might have noticed that XML documents tend to be large, and
that passing large documents around the Internet will require high bandwidth, and
that building and parsing XML documents will take time, time that might better
be spent on the calculation itself. For these reasons, Web services are typically
not appropriate for fine-grained calculations such as the sin (
t )example where
there is a large amount of data passed between client and server.
In a large-grained scientific application in which the calculation time is large
compared to the data transmission time, web services might be an excellent
solution. Web services are straightforward to implement, and the technology is
so popular that it is understood by many people.
ω
21.5 Other web services technologies
We do not want to leave the impression that web services are no more complicated
than the relatively simple Java servlet technology. In fact, web services are usually
thought of as more than Java servlets. There are many other technologies in
use in the Web services arena, including wrapping XML documents in Simple
Object Access Protocol (SOAP) wrappers, the use of the Universal Description,
Search WWH ::




Custom Search