Passing com object from simple xmlrpc server to client

T

tsjuan

Hello python users,

I am just learning on how to use xmlrpc and stumbled upon how to pass
com object
from server to client side.

The client side complain about can't marshall the com object. I don't
know what type
of marshall command I should use to pass the object.

Below are my scripts, any help / comments are greatly appreciated:

# Server Side script
# ===============

import win32com.client
import SimpleXMLRPCServer
import pythoncom

class ServerFunctions(object):

def call_com_object(self):
pythoncom.CoInitialize()
return win32com.client.Dispatch('excel.application')

if __name__ == '__main__'
server =
SimpleXMLRPCServer.SimpleXMLROCServer(('hostname',portnumber))
server.register_instance(ServerFunctions())


# Client Side Script
# ==============

import xmlrpclib
client = xmlrpclib.Server('http://hostname:portname")
excel_object = client.call_com_object()



Regards,
Tanto Sugiarto
 
D

Diez B. Roggisch

tsjuan said:
Hello python users,

I am just learning on how to use xmlrpc and stumbled upon how to pass
com object
from server to client side.

The client side complain about can't marshall the com object. I don't
know what type
of marshall command I should use to pass the object.

you can't do that. COM is a interprocess-communication facility that
doesn't have a value - which is what marshalling tries to accomplish:
create a wire-representation of a value.

If you are using COM anyway, why don't you use DCOM instead of XMLRPC -
then things could work.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top