OSE -- I EAT Penguins !!!!

General Information

Project Resources

User Documentation

Developer Resources

For a printable version of this page, go here.

For a printable PDF version of the complete manual this document belongs to, go here.

Copyright © 2001-2002
Dumpleton Software Consulting.
http://www.dscpl.com.au
http://ose.sourceforge.net

SourceForge Logo

Python Modules


OSE includes a number of Python modules. The main module is a wrapper around functionality provided in the OSE C++ class library. Those parts of the OSE C++ class library for which a Python wrapper are provided are the logging system, the real time events system, the service agent framework for creating distributed applications and the HTTP servlet framework.

Additional modules provide access to the OSE service agent framework using an RPC over HTTP protocol called NET-RPC as well as the XML-RPC and SOAP protocol. Note that the XML-RPC and SOAP protocols come with restrictions deriving from problems in the respective protocols and the NET-RPC protocol provides the best integration.

Because interfaces are provided for the OSE service agent framework in both C++ and Python, an application may be spread across multiple processes and consist of processes written using either C++ or Python code. Using shared libraries and dynamic loading, C or C++ code could also be loaded into Python to perform some functions if desired.

Overall, the Python wrappers provide an interface to the functionality of the OSE C++ class library which is easier to use than if the C++ class library were used directly. This makes the Python wrappers ideal for building up the overall structure of a distributed system, with C++ code being used only when necessary.

Module Descriptions

The Python modules, their names and their purpose are described below.
Module
Purpose
netsvc
This is the main module and provides wrappers around the functionality of the OSE C++ class library. It includes all that is required for building distributed applications using the service agent framework.
netrpc
This module provides a client implementation of the RPC over HTTP protocol implemented by OSE called NET-RPC.
netsvc.xmlrpc
This module includes the XML-RPC gateway for OSE. Any server code is the same as for when the NET-RPC protocol is used. The only difference is which gateway you instantiate.
netrpc.xmlrpc
This module provides a client implementation of the XML-RPC protocol. The module is interface compatible with the"netrpc" module.
netsvc.soap
This module includes the SOAP gateway for OSE. Any server code is the same as for when the NET-RPC protocol is used. The only difference is which gateway you instantiate.
netrpc.soap
This module provides a client implementation of the SOAP protocol. The module is interface compatible with the"netrpc" module.

Installation and Setup

The "netsvc" module requires the main OSE C++ class library to be installed, as well as the Python extension library. The version of "makeit" installed when OSE is installed needs to be run in the "python" subdirectory of the OSE source code. This final step will install the two Python modules, a dynamically loadable module which drags in the OSE C++ class libraries and a GUI based debugger for the service agent framework called "spyon". The exact steps which need to be followed are given in the "INSTALL" file in the OSE source code.

When the Python modules are installed, they are not installed into your Python installation, but into the same area that OSE is installed. In order that Python can find the modules, you will need to set your PYTHONPATH environment variable to include the appropriate library directory in the OSE installation. For OSE 7.0, if installed into its standard location, the directory will be:

 /usr/local/ose/7.0/lib/python

An OSE installation supports libraries for different architectures. In order that the shared libraries for your specific platform can be found by the Python module, you should ensure that the OSE_HOST variable is set to the same value it was set to when OSE was installed. For example:

 OSE_HOST=X86_LINUX

If you want to be able to run the "spyon" debugger, your PATH environment variable should include the OSE bin directory. For OSE 7.0, if installed into its standard location, the directory will be:

 /usr/local/ose/7.0/bin

If you want to be able to build up a version of the Python wrappers with a DLL for Win32, you have two choices. The first requires you to have access to either the Cygnus Win32 toolkit or MKS toolkit, and the Microsoft C++ compiler. In this case the normal build procedure for OSE is followed. If you only have access to the Microsoft C++ compiler, a native makefile is provided with the source code in the "win32" directory. You should follow the instructions contained in that directory.

Note that if you wish to use either the SOAP client or SOAP gateway, you will need to separately obtain and install the "ZSI" package from the "pywebsvcs" project on SourceForge. The project site address is "http://sourceforge.net/projects/pywebsvcs". You must have version 1.2 RC2 or later of the ZSI package.

Additional Information

As the main Python module is a wrapper around functionality provided in the OSE C++ class libraries, it may be worthwhile to also consult the manual pages for the corresponding classes in the C++ class library and the general C++ class library manual. The behaviour of some features is controlled using environment variables and not all of these may be mentioned in the manual for the Python modules.