views:

322

answers:

1

I have Windows service (acts as a server) that I want to test using Python scripts. This service is written in C++ and exposes several RPC functions that other services consume. I want to mock those other services using my Python program and call those RPC functions from the script. This is the first stage. The second stage happens when the server service responds to its caller service by another RPC call. How can this be done in Python?

If Python (or any of its extensions) can't call/receive the RPCs, can this be done if I change the main server service code and added whatever code is necessary, which will end up calling the same functionality the RPCs used to execute but will be callable from Python?

Note: The server service implements the RPC functions using raw Windows RPC implemented with IDL files. Other services, which are written in C++ too, interested in consuming those RPCs are using the IDL file to generate the needed interface to do the communication. Using XML-RPC or other technologies aren't an option.

+1  A: 

What kind of RPC are you thinking of? If it is XML-RPC, then Python comes with the SimpleXMLRPCServer module, which, well, allows you to write RPC servers in Python.

If the remote server uses DCOM, you can use PythonCOM.

Martin v. Löwis
It's raw Windows RPC implemented using IDL files.
haggag
@haggag You mean COM, perhaps?
Pavel Repin