Python 7.0pl5 Benutzerhandbuch

Seite von 124
111
Remote Access
The service agent and message exchange framework operate based on the concept of processes which
are a part of a distributed application being permanently connected together. This model works fine on
corporate networks, but is not always practical when run across the Internet. One drawback of this ap-
proach is that it is often necessary to open up special ports on a corporate firewall to permit access.
For many instances where communication across the Internet is required, a connected model of oper-
ation isn’t actually required. Instead, many types of operations can be carried out using a request/reply
model whereby a connection is only maintained for the lifetime of the request. This is precisely the
type of mechanism which is used by HTTP.
Because of the wide acceptance for HTTP a number of remote procedure call protocols have been de-
veloped which operate within the bounds of a HTTP request. The most well known of these are XML-
RPC and SOAP. Unfortunately, both of these protocols are actually lacking in certain respects and
have not been found to be a totally satisfactory medium.
In place of these protocols, an alternative RPC over HTTP protocol is provided called NET-RPC. At
present, the only client available is implemented using Python. If you are writing a closed system this
shouldn’t present a problem. In those cases where public access may be required, gateways for XML-
RPC and SOAP are still available, but using them will place a limitation on the type of data which you
can pass around.
Note that whichever RPC over HTTP protocol you do decide to use, the code for your services is the
same. In fact, your application may include gateways for all three protocols and a user can use which-
ever type of client they find easiest. In this respect, it doesn’t matter too much which protocol wins out.