Java Reference
In-Depth Information
4. Examined the Calc and CalcService files (the pattern's the same for any service);
the service name will be an interface and the factory for it will be the service name
with the word Service appended.
5. Invoked the getCalcService() method on the factory, to get the client-side Calc
“stub” object.
6. Invoked methods on the stub.
See Also
There is much more to SOAP Web Services than this. The issues surrounding larger, more
complex web services are the same as for any type of network service: reliability, server up-
time, and so on. The connection could fail at any time due to a server crash or network out-
age. There are higher-level protocols for reliability, security/encryption, and so on. But even
with these, the network can still fail, so the client should be prepared for the possibility of a
SOAP fault propagating back. It is somewhat common to structure the web service return
value to be a tuple (sequence) of an integer indicating sucess or various error codes, imple-
mented as an enumeration, a string error message (in case an old client meets a new server
and doesn't understand some of the error codes), and the actual return data—the calculation
result, in our example. Java Web Services: Up and Running (O'Reilly) has more details.
Program: Telnet Client
This program is a simple Telnet client. Telnet, as you probably know, is the oldest surviving
remote login program in use on the Internet. It began on the original ARPAnet and was later
translated for the Internet. A Unix command-line client lives on, and several windowed cli-
ents are in circulation. For security reasons, the use of Telnet as a means of logging in re-
motely over the Internet has largely been superseded by SSH . However, a Telnet client re-
mains a necessity for such purposes as connecting locally, as well as debugging textual sock-
et servers and understanding their protocols. For example, it is common to connect from a
Telnet client to an SMTP (email) server; you can often intuit quite a bit about the SMTP
server, even if you wouldn't normally type an entire mail session interactively.
When you need to have data copied in both directions at roughly the same time—from the
keyboard to the remote program, and from the remote program to the screen—there are two
approaches. Some I/O libraries in C have a function called poll() or select() that allows
Search WWH ::




Custom Search