Passing com object from simple xmlrpc server to client

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tsjuan

    #1

    Passing com object from simple xmlrpc server to client

    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 SimpleXMLRPCSer ver
    import pythoncom

    class ServerFunctions (object):

    def call_com_object (self):
    pythoncom.CoIni tialize()
    return win32com.client .Dispatch('exce l.application')

    if __name__ == '__main__'
    server =
    SimpleXMLRPCSer ver.SimpleXMLRO CServer(('hostn ame',portnumber ))
    server.register _instance(Serve rFunctions())


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

    import xmlrpclib
    client = xmlrpclib.Serve r('http://hostname:portna me")
    excel_object = client.call_com _object()



    Regards,
    Tanto Sugiarto

  • Diez B. Roggisch

    #2
    Re: Passing com object from simple xmlrpc server to client

    tsjuan schrieb:
    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

    Comment

    Working...